diff options
author | fujinhua <fu.jinhua@zte.com.cn> | 2018-11-24 19:31:26 +0800 |
---|---|---|
committer | Fu Jinhua <fu.jinhua@zte.com.cn> | 2018-11-24 11:41:25 +0000 |
commit | 4738a2d046162e289559cc1e9c2bbef101768a21 (patch) | |
tree | 30339cecbc42e4735ea865975f8deb1211508b19 | |
parent | 82fc2f1d8085b864b40a569a5d1a7d13d22df662 (diff) |
Add Lock for create port
Change-Id: I74599039c589f020a60d1c3fd96e472f0588c23e
Issue-ID: VFC-1163
Signed-off-by: fujinhua <fu.jinhua@zte.com.cn>
(cherry picked from commit f23897f17f2c4a65c09f3d697292dc40d8fe54cc)
-rw-r--r-- | lcm/lcm/pub/vimapi/api.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lcm/lcm/pub/vimapi/api.py b/lcm/lcm/pub/vimapi/api.py index b46bbf4b..ba84442f 100644 --- a/lcm/lcm/pub/vimapi/api.py +++ b/lcm/lcm/pub/vimapi/api.py @@ -23,6 +23,7 @@ from .exceptions import VimException VIM_DRIVER_BASE_URL = "api/multicloud/v0" MUTEX_NET = Lock() MUTEX_SUBNET = Lock() +MUTEX_PORT = Lock() def call(vim_id, tenant_id, res, method, data=''): @@ -102,7 +103,8 @@ def list_subnet(vim_id, tenant_id): def create_port(vim_id, tenant_id, data): - return call(vim_id, tenant_id, "ports", "POST", data) + with MUTEX_PORT: + return call(vim_id, tenant_id, "ports", "POST", data) def delete_port(vim_id, tenant_id, port_id): |