summaryrefslogtreecommitdiffstats
path: root/lcm
diff options
context:
space:
mode:
authorying.yunlong <ying.yunlong@zte.com.cn>2017-02-23 13:34:36 +0800
committerying.yunlong <ying.yunlong@zte.com.cn>2017-02-23 13:34:36 +0800
commitaf92e41531478354fe089d81822cc7ed82cc59c1 (patch)
tree401a46555601b63daf6234f5b3b73a98858eb6be /lcm
parent475036dd969bc09092ad712d7c50f73171d4d317 (diff)
Modify code of create port
Change-Id: I2d4546c9bfda3d9110c42923368f8a8bde5e4487 Issue-Id: GVNFM-12 Signed-off-by: ying.yunlong <ying.yunlong@zte.com.cn>
Diffstat (limited to 'lcm')
-rw-r--r--lcm/lcm/nf/vnfs/vnf_create/inst_vnf.py18
-rw-r--r--lcm/lcm/pub/database/models.py2
2 files changed, 13 insertions, 7 deletions
diff --git a/lcm/lcm/nf/vnfs/vnf_create/inst_vnf.py b/lcm/lcm/nf/vnfs/vnf_create/inst_vnf.py
index 6bc996fb..5d622741 100644
--- a/lcm/lcm/nf/vnfs/vnf_create/inst_vnf.py
+++ b/lcm/lcm/nf/vnfs/vnf_create/inst_vnf.py
@@ -438,14 +438,18 @@ class InstVnf(Thread):
JobUtil.add_job_status(self.job_id, 50, 'Create ports!')
PortInstModel.objects.create(
portid=str(uuid.uuid4()),
- networkid=ret["networkId"],
- subnetworkid=ret["subnetId"],
- vimid=ret["vimId"],
- resouceid=ret["id"],
- name=ret["name"],
- tenant=ret["tenatId"],
+ networkid=ignore_case_get(ret, "networkId"),
+ subnetworkid=ignore_case_get(ret, "subnetId"),
+ name=ignore_case_get(ret, "name"),
+ vimid=ignore_case_get(ret, "vimId"),
+ resouceid=ignore_case_get(ret, "id"),
+ tenant=ignore_case_get(ret, "tenantId"),
+ macaddress = ignore_case_get(ret, "macAddress"),
+ ipaddress = ignore_case_get(ret, "ip"),
+ typevirtualnic=ignore_case_get(ret, "vnicType"),
+ securityGroups=ignore_case_get(ret, "securityGroups"),
insttype=0,
- is_predefined=ret["returnCode"],
+ is_predefined=ignore_case_get(ret, "returnCode"),
instid=self.nf_inst_id)
elif res_type == adaptor.RES_FLAVOR:
logger.info('Create flavors!')
diff --git a/lcm/lcm/pub/database/models.py b/lcm/lcm/pub/database/models.py
index a765e24f..de986a11 100644
--- a/lcm/lcm/pub/database/models.py
+++ b/lcm/lcm/pub/database/models.py
@@ -247,6 +247,8 @@ class PortInstModel(models.Model):
interfacename = models.CharField(db_column='INTERFACENAME', max_length=255, blank=True, null=True)
vmid = models.CharField(db_column='VMID', max_length=255, blank=True, null=True)
create_time = models.CharField(db_column='CREATETIME', max_length=200, null=True, blank=True)
+ securityGroups = models.CharField(db_column='SECURITYGROUPS', max_length=255)
+ is_predefined = models.IntegerField(db_column='ISPREDEFINED', default=0, null=True)
class CPInstModel(models.Model):
class Meta: