X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=osm_openvim%2Fovim.py;h=6317421d9d865d3872c0ae91b02a53bb1b429224;hb=refs%2Fchanges%2F24%2F2024%2F8;hp=2fca38fe83a193f475418afa1cb27991226f8373;hpb=c67abe2ff35fcdd5b85db97915a7833ab31beb56;p=osm%2Fopenvim.git diff --git a/osm_openvim/ovim.py b/osm_openvim/ovim.py index 2fca38f..6317421 100755 --- a/osm_openvim/ovim.py +++ b/osm_openvim/ovim.py @@ -286,8 +286,21 @@ class ovim(): if (net_type == 'bridge_data' or net_type == 'bridge_man') and \ net["provider"][:4] == 'OVS:' and net["enable_dhcp"] == "true": try: - routes = yaml.safe_load(net.get('routes')) - dns = yaml.safe_load(net.get('dns')) + config_routes = net.get('routes') + if config_routes: + routes = yaml.safe_load(config_routes) + else: + routes = None + + config_dns = net.get('dns') + if config_dns: + dns = yaml.safe_load(config_dns) + else: + dns = None + + links = net.get('links') + if links: + links = yaml.safe_load(net.get('links')) self.launch_dhcp_server(net.get('vlan'), net.get('dhcp_first_ip'), net.get('dhcp_last_ip'), @@ -295,7 +308,7 @@ class ovim(): net.get('gateway_ip'), dns, routes) - self.launch_link_bridge_to_ovs(net['vlan'], net.get('links'), net.get('routes')) + self.launch_link_bridge_to_ovs(net['vlan'], net.get('gateway_ip'), net.get('cidr'), links, routes) 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)) @@ -1422,7 +1435,7 @@ class ovim(): dhcp_path = self.config['ovs_controller_file_path'] controller_host = self.get_dhcp_controller() - # TODO leo check if is need ti to create an ovim-vlan bridge, looks like not + # controller_host.create_linux_bridge(vlan) controller_host.create_dhcp_interfaces(vlan, first_ip, dhcp_netmask) dhcp_path = self.config['ovs_controller_file_path']