(bug 283) fixed error at vnf creation on missing vpci for dataplane interfaces 94/1894/4
authortierno <alfonso.tiernosepulveda@telefonica.com>
Tue, 30 May 2017 15:12:00 +0000 (17:12 +0200)
committertierno <alfonso.tiernosepulveda@telefonica.com>
Mon, 5 Jun 2017 14:31:03 +0000 (16:31 +0200)
Change-Id: I45541219873336dd7a8f8ec155ad0772404ad51a
Signed-off-by: tierno <alfonso.tiernosepulveda@telefonica.com>
osm_ro/nfvo_db.py

index ea6d339..ac392c6 100644 (file)
@@ -107,7 +107,7 @@ class nfvo_db(db_base.db_base):
                                 created_time += 0.00001
                                 db_base._convert_bandwidth(dataiface, logger=self.logger)
                                 dataifacesDict[vm['name']][dataiface['name']] = {}
-                                dataifacesDict[vm['name']][dataiface['name']]['vpci'] = dataiface['vpci']
+                                dataifacesDict[vm['name']][dataiface['name']]['vpci'] = dataiface.get('vpci')
                                 dataifacesDict[vm['name']][dataiface['name']]['bw'] = dataiface['bandwidth']
                                 dataifacesDict[vm['name']][dataiface['name']]['model'] = "PF" if dataiface[
                                                                                                      'dedicated'] == "yes" else (
@@ -258,7 +258,7 @@ class nfvo_db(db_base.db_base):
                                 created_time += 0.00001
                                 db_base._convert_bandwidth(dataiface, logger=self.logger)
                                 ifaceDict = {}
-                                ifaceDict['vpci'] = dataiface['vpci']
+                                ifaceDict['vpci'] = dataiface.get('vpci')
                                 ifaceDict['bw'] = dataiface['bandwidth']
                                 ifaceDict['model'] = "PF" if dataiface['dedicated'] == "yes" else \
                                     ("VF" if dataiface['dedicated'] == "no" else "VFnotShared")