diff options
author | fujinhua <fu.jinhua@zte.com.cn> | 2018-11-24 19:31:26 +0800 |
---|---|---|
committer | fujinhua <fu.jinhua@zte.com.cn> | 2018-11-24 19:31:26 +0800 |
commit | f23897f17f2c4a65c09f3d697292dc40d8fe54cc (patch) | |
tree | 30339cecbc42e4735ea865975f8deb1211508b19 | |
parent | 962b48bfee74f301000b2afae937dcb45ab9ec1c (diff) |
Add Lock for create port
Change-Id: I74599039c589f020a60d1c3fd96e472f0588c23e
Issue-ID: VFC-1163
Signed-off-by: fujinhua <fu.jinhua@zte.com.cn>
-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): |