set network status to ACTIVE at service start
[osm/openvim.git] / osm_openvim / vim_db.py
index 0c2d9f1..355bbac 100644 (file)
@@ -1428,9 +1428,12 @@ class vim_db():
                             used_dhcp_ips = self._get_dhcp_ip_used_list(iface["net_id"])
                             iface["ip_address"] = self.get_free_ip_from_range(dhcp_first_ip, dhcp_last_ip,
                                                                               dhcp_cidr, used_dhcp_ips)
-                            del iface['links']
-                            del iface['dns']
-                            del iface['routes']
+                            if 'links' in iface:
+                                del iface['links']
+                            if 'dns' in iface:
+                                del iface['dns']
+                            if 'routes' in iface:
+                                del iface['routes']
 
                         iface['uuid'] = str(myUuid.uuid1()) # create_uuid
                         cmd = "INSERT INTO uuids (uuid, root_uuid, used_at) VALUES ('%s','%s', 'ports')" % (iface['uuid'], uuid)