Change-Id: I09f08261bf333570bcc9780d07c580533555e30d
Issue-ID: VFC-1163
Signed-off-by: fujinhua <fu.jinhua@zte.com.cn>
# limitations under the License.
import json
# limitations under the License.
import json
+from multiprocessing import Lock
from lcm.pub.msapi.aai import delete_aai_flavor
from lcm.pub.utils.restcall import req_by_msb
from .exceptions import VimException
VIM_DRIVER_BASE_URL = "api/multicloud/v0"
from lcm.pub.msapi.aai import delete_aai_flavor
from lcm.pub.utils.restcall import req_by_msb
from .exceptions import VimException
VIM_DRIVER_BASE_URL = "api/multicloud/v0"
+MUTEX_NET = Lock()
+MUTEX_SUBNET = Lock()
def call(vim_id, tenant_id, res, method, data=''):
def call(vim_id, tenant_id, res, method, data=''):
def create_network(vim_id, tenant_id, data):
def create_network(vim_id, tenant_id, data):
- return call(vim_id, tenant_id, "networks", "POST", data)
+ with MUTEX_NET:
+ return call(vim_id, tenant_id, "networks", "POST", data)
def delete_network(vim_id, tenant_id, network_id):
def delete_network(vim_id, tenant_id, network_id):
def create_subnet(vim_id, tenant_id, data):
def create_subnet(vim_id, tenant_id, data):
- return call(vim_id, tenant_id, "subnets", "POST", data)
+ with MUTEX_SUBNET:
+ return call(vim_id, tenant_id, "subnets", "POST", data)
def delete_subnet(vim_id, tenant_id, subnet_id):
def delete_subnet(vim_id, tenant_id, subnet_id):