diff options
author | dyh <dengyuanhong@chinamobile.com> | 2020-10-28 15:19:33 +0800 |
---|---|---|
committer | dyh <dengyuanhong@chinamobile.com> | 2020-10-28 15:50:39 +0800 |
commit | 2c57fdc3462fb59fd2643faade6355e278bfc014 (patch) | |
tree | b230eee4ac7e1a6157e17ca27eca5eda0ee1a66e | |
parent | 33e2dbde71544baad683d5240cda3e7b32bc5795 (diff) |
Don't write information to resmanagement
Change-Id: I9f866be27166b0c6154d9fe1649398f61de2a5de
Issue-ID: VFC-1762
Signed-off-by: dyh <dengyuanhong@chinamobile.com>
-rw-r--r-- | lcm/ns_sfcs/biz/delete_sfcs.py | 2 | ||||
-rw-r--r-- | lcm/ns_vls/biz/create_vls.py | 2 | ||||
-rw-r--r-- | lcm/ns_vls/biz/delete_vls.py | 2 | ||||
-rw-r--r-- | lcm/ns_vnfs/biz/create_vnfs.py | 4 | ||||
-rw-r--r-- | lcm/ns_vnfs/biz/grant_vnf.py | 23 | ||||
-rw-r--r-- | lcm/ns_vnfs/biz/terminate_nfs.py | 2 | ||||
-rw-r--r-- | lcm/ns_vnfs/tests/tests.py | 18 | ||||
-rw-r--r-- | lcm/pub/utils/restcall.py | 2 | ||||
-rw-r--r-- | tox.ini | 2 |
9 files changed, 21 insertions, 36 deletions
diff --git a/lcm/ns_sfcs/biz/delete_sfcs.py b/lcm/ns_sfcs/biz/delete_sfcs.py index 292e83e1..34d6cf20 100644 --- a/lcm/ns_sfcs/biz/delete_sfcs.py +++ b/lcm/ns_sfcs/biz/delete_sfcs.py @@ -36,7 +36,7 @@ class DeleteSfcs(object): return {"result": 0, "detail": "sfc is not exist or has been already deleted"} self.ns_inst_id = sfc_inst_info[0].nsinstid self.delete_sfc_from_driver(sfc_inst_info[0]) - self.delete_sfc_from_resmgr() + # self.delete_sfc_from_resmgr() self.delete_sfc_from_db(sfc_inst_info) return {"result": 0, "detail": "delete sfc success"} except NSLCMException as e: diff --git a/lcm/ns_vls/biz/create_vls.py b/lcm/ns_vls/biz/create_vls.py index 7d322310..1a65d889 100644 --- a/lcm/ns_vls/biz/create_vls.py +++ b/lcm/ns_vls/biz/create_vls.py @@ -55,7 +55,7 @@ class CreateVls(object): try: self.get_data() self.create_vl_to_vim() - self.create_vl_to_resmgr() + # self.create_vl_to_resmgr() self.save_vl_to_db() if REPORT_TO_AAI: self.create_network_aai() diff --git a/lcm/ns_vls/biz/delete_vls.py b/lcm/ns_vls/biz/delete_vls.py index 65ca90d6..6424d4de 100644 --- a/lcm/ns_vls/biz/delete_vls.py +++ b/lcm/ns_vls/biz/delete_vls.py @@ -44,7 +44,7 @@ class DeleteVls(object): subnetwork_id_list = vl_inst_info[0].relatedsubnetworkid.split(",") network_id = vl_inst_info[0].relatednetworkid self.delete_vl_from_vim(vim_id, subnetwork_id_list, network_id) - self.delete_vl_from_resmgr() + # self.delete_vl_from_resmgr() if REPORT_TO_AAI: self.delete_network_and_subnet_in_aai() self.delete_vl_from_db(vl_inst_info) diff --git a/lcm/ns_vnfs/biz/create_vnfs.py b/lcm/ns_vnfs/biz/create_vnfs.py index 3e984717..ca7ca572 100644 --- a/lcm/ns_vnfs/biz/create_vnfs.py +++ b/lcm/ns_vnfs/biz/create_vnfs.py @@ -89,10 +89,10 @@ class CreateVnfs(Thread): self.send_nf_init_request_to_vnfm() self.send_homing_request_to_OOF() self.send_get_vnfm_request_to_extsys() - self.send_create_vnf_request_to_resmgr() + # self.send_create_vnf_request_to_resmgr() self.wait_vnfm_job_finish() self.subscribe() - self.write_vnf_creation_info() + # self.write_vnf_creation_info() self.save_info_to_db() JobUtil.add_job_status(self.job_id, JOB_PROGRESS.FINISHED, 'vnf instantiation success', JOB_ERROR_CODE.NO_ERROR) except NSLCMException as e: diff --git a/lcm/ns_vnfs/biz/grant_vnf.py b/lcm/ns_vnfs/biz/grant_vnf.py index 9c869ea1..40442e92 100644 --- a/lcm/ns_vnfs/biz/grant_vnf.py +++ b/lcm/ns_vnfs/biz/grant_vnf.py @@ -20,7 +20,6 @@ from lcm.pub.database.models import NfInstModel, OOFDataModel from lcm.pub.exceptions import NSLCMException from lcm.pub.msapi.sdc_run_catalog import query_vnfpackage_by_id from lcm.pub.utils.values import ignore_case_get -from lcm.pub.msapi import resmgr from lcm.ns_vnfs.const import SCALAR_UNIT_DICT logger = logging.getLogger(__name__) @@ -90,17 +89,17 @@ class GrantVnf(object): break req_param[grant_type].append(grant_res) self.data = req_param - tmp = resmgr.grant_vnf(self.data) - vimConnections.append( - { - "id": tmp["vim"]["vimId"], - "vimId": tmp["vim"]["vimId"], - "vimType": None, - "interfaceInfo": None, - "accessInfo": tmp["vim"]["accessInfo"], - "extra": None - } - ) + # tmp = resmgr.grant_vnf(self.data) + # vimConnections.append( + # { + # "id": tmp["vim"]["vimId"], + # "vimId": tmp["vim"]["vimId"], + # "vimType": None, + # "interfaceInfo": None, + # "accessInfo": tmp["vim"]["accessInfo"], + # "extra": None + # } + # ) grant_resp = { "id": str(uuid.uuid4()), diff --git a/lcm/ns_vnfs/biz/terminate_nfs.py b/lcm/ns_vnfs/biz/terminate_nfs.py index 397460ea..c663669b 100644 --- a/lcm/ns_vnfs/biz/terminate_nfs.py +++ b/lcm/ns_vnfs/biz/terminate_nfs.py @@ -57,7 +57,7 @@ class TerminateVnfs(threading.Thread): self.check_nf_valid() self.send_nf_terminate_to_vnfmDriver() self.wait_vnfm_job_finish() - self.send_terminate_vnf_to_resMgr() + # self.send_terminate_vnf_to_resMgr() if REPORT_TO_AAI: self.delete_vserver_in_aai() self.delete_vnf_in_aai() diff --git a/lcm/ns_vnfs/tests/tests.py b/lcm/ns_vnfs/tests/tests.py index e67c0d5e..25997490 100644 --- a/lcm/ns_vnfs/tests/tests.py +++ b/lcm/ns_vnfs/tests/tests.py @@ -1013,14 +1013,7 @@ class TestGrantVnfViews(TestCase): resp = GrantVnf(json.dumps(self.data)).exec_grant() self.assertEqual(resp["vnfInstanceId"], "add_resources_but_no_off") self.assertEqual(resp["vnfLcmOpOccId"], "vnf_lcm_op_occ_id") - vimConnections = [{ - "id": "cloudOwner_casa", - "vimId": "cloudOwner_casa", - "vimType": None, - "interfaceInfo": None, - "accessInfo": {"tenant": "tenantA"}, - "extra": None - }] + vimConnections = [] self.assertEqual(resp["vimConnections"], vimConnections) @mock.patch.object(resmgr, "grant_vnf") @@ -1113,14 +1106,7 @@ class TestGrantVnfViews(TestCase): resp = GrantVnf(json.dumps(self.data)).exec_grant() self.assertEqual(resp["vnfInstanceId"], "remove_resources_but_no_off") self.assertEqual(resp["vnfLcmOpOccId"], "vnf_lcm_op_occ_id") - vimConnections = [{ - "id": "cloudOwner_casa", - "vimId": "cloudOwner_casa", - "vimType": None, - "interfaceInfo": None, - "accessInfo": {"tenant": "tenantA"}, - "extra": None - }] + vimConnections = [] self.assertEqual(resp["vimConnections"], vimConnections) @mock.patch.object(resmgr, "grant_vnf") diff --git a/lcm/pub/utils/restcall.py b/lcm/pub/utils/restcall.py index b2f14e3c..b6c0ad60 100644 --- a/lcm/pub/utils/restcall.py +++ b/lcm/pub/utils/restcall.py @@ -73,7 +73,7 @@ def call_req(base_url, user, passwd, auth_type, resource, method, content='', ad raise ex except urllib.error.URLError as err: ret = [2, str(err), resp_status, resp_Location] - except Exception as ex: + except Exception: logger.error(traceback.format_exc()) logger.error("[%s]ret=%s" % (callid, str(sys.exc_info()))) res_info = str(sys.exc_info()) @@ -7,7 +7,7 @@ downloadcache = ~/cache/pip [flake8] ignore = E501,E722 -exclude = ./venv-tox,./.tox +exclude = ./venv-tox,./.tox,./venv max-complexity = 27 [testenv] |