diff options
author | Ruoyu <ruoyu.ying@intel.com> | 2018-11-28 22:06:42 +0000 |
---|---|---|
committer | Ruoyu <ruoyu.ying@intel.com> | 2018-11-28 22:08:29 +0000 |
commit | 9cd20c3a0d033a07b8526d17e7b4439bda83bd3c (patch) | |
tree | 3605c61d92cb8c6d46d7367808e00a291ba27233 | |
parent | f517ab862a25ed12cd1ba687d93a03285cbc7259 (diff) |
(RFC) Fix bugs in VFC-OOF interaction
Here lists all the bugs find and changes.
Change-Id: I36bc3f46e8abaf48d66916b647988be286fbe11e
Issue-ID: VFC-941
Signed-off-by: Ruoyu <ruoyu.ying@intel.com>
-rw-r--r-- | lcm/ns_vnfs/biz/grant_vnf.py | 23 | ||||
-rw-r--r-- | lcm/pub/config/config.py | 2 | ||||
-rw-r--r-- | lcm/pub/database/models.py | 2 |
3 files changed, 15 insertions, 12 deletions
diff --git a/lcm/ns_vnfs/biz/grant_vnf.py b/lcm/ns_vnfs/biz/grant_vnf.py index 6891ee9d..4d87c231 100644 --- a/lcm/ns_vnfs/biz/grant_vnf.py +++ b/lcm/ns_vnfs/biz/grant_vnf.py @@ -116,16 +116,19 @@ class GrantVnf(object): logger.debug("Cannot find oof data, retry%s" % (i + 1)) time.sleep(5) continue - vdu_info = json.loads(offs[0].vdu_info) - grant_resp['vimAssets'] = {'computeResourceFlavours': []} - for vdu in vdu_info: - grant_resp['vimAssets']['computeResourceFlavours'].append({ - 'vimConnectionId': offs[0].vim_id, - 'resourceProviderId': vdu.get("vduName"), - 'vnfdVirtualComputeDescId': None, # TODO: required - 'vimFlavourId': vdu.get("flavorId") - }) - # grant_resp['additionalparams'][off.vim_id] = off.directive + try: + vdu_info = json.loads(offs[0].vdu_info) + grant_resp['vimAssets'] = {'computeResourceFlavours': []} + for vdu in vdu_info: + grant_resp['vimAssets']['computeResourceFlavours'].append({ + 'vimConnectionId': offs[0].vim_id, + 'resourceProviderId': vdu.get("vduName"), + 'vnfdVirtualComputeDescId': None, # TODO: required + 'vimFlavourId': vdu.get("flavorId") + }) + # grant_resp['additionalparams'][off.vim_id] = off.directive + except Exception: + logger.debug("Load OOF data error") break logger.debug("grant_resp=%s", grant_resp) diff --git a/lcm/pub/config/config.py b/lcm/pub/config/config.py index 3e64583f..0d47b962 100644 --- a/lcm/pub/config/config.py +++ b/lcm/pub/config/config.py @@ -70,7 +70,7 @@ DEPLOY_WORKFLOW_WHEN_START = False WORKFLOW_OPTION = "buildin" # [OOF config] -OOF_BASE_URL = "http://oof-osdf.onap.org:8698" +OOF_BASE_URL = "http://oof-osdf.onap:8698" OOF_USER = "vfc_test" OOF_PASSWD = "vfc_testpwd" diff --git a/lcm/pub/database/models.py b/lcm/pub/database/models.py index 1e70dbc7..b45867a5 100644 --- a/lcm/pub/database/models.py +++ b/lcm/pub/database/models.py @@ -325,7 +325,7 @@ class OOFDataModel(models.Model): transaction_id = models.CharField(db_column='TRANSACTIONID', max_length=255) request_status = models.CharField(db_column='REQUESTSTATUS', max_length=50) request_module_name = models.CharField(db_column='RESOURCEMODULENAME', max_length=100) - service_resource_id = models.CharField(db_column='SERVICERESOURCEID', max_length=255) + service_resource_id = models.CharField(db_column='SERVICERESOURCEID', max_length=255, primary_key=True) vim_id = models.CharField(db_column='VIMID', max_length=255, null=True, blank=True) cloud_owner = models.CharField(db_column='CLOUDOWNER', max_length=100, null=True, blank=True) cloud_region_id = models.CharField(db_column='CLOUDREGIONID', max_length=255, null=True, blank=True) |