X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=osm_openvim%2Fovim.py;fp=osm_openvim%2Fovim.py;h=5650cd50707d1d6b43310cea556bcc5b6f00431a;hb=1d5c229ff0fbd9f4f10a2cac76c779522411a524;hp=6317421d9d865d3872c0ae91b02a53bb1b429224;hpb=c8a24a81d511a3340cee0c55c7eb106d30a3e3e1;p=osm%2Fopenvim.git diff --git a/osm_openvim/ovim.py b/osm_openvim/ovim.py index 6317421..5650cd5 100755 --- a/osm_openvim/ovim.py +++ b/osm_openvim/ovim.py @@ -283,7 +283,7 @@ class ovim(): for net in content: net_type = net['type'] - if (net_type == 'bridge_data' or net_type == 'bridge_man') and \ + if net['status'] != "INACTIVE" and (net_type == 'bridge_data' or net_type == 'bridge_man') and \ net["provider"][:4] == 'OVS:' and net["enable_dhcp"] == "true": try: config_routes = net.get('routes') @@ -309,12 +309,15 @@ class ovim(): dns, routes) self.launch_link_bridge_to_ovs(net['vlan'], net.get('gateway_ip'), net.get('cidr'), links, routes) + if net["status"] == "ERROR": + self.db.update_rows("nets", UPDATE={"status": "ACTIVE", "last_error": None}, + WHERE={"uuid": net["uuid"]}) except Exception as e: self.logger.error("Fail at launching dhcp server for net_id='%s' net_name='%s': %s", net["uuid"], net["name"], str(e)) - self.db.update_rows("nets", {"status": "ERROR", + self.db.update_rows("nets", UPDATE={"status": "ERROR", "last_error": "Fail at launching dhcp server: " + str(e)}, - {"uuid": net["uuid"]}) + WHERE={"uuid": net["uuid"]}) def _start_of_db_tasks(self): """