Refactor ssh commands
Change-Id: Ie53ada0071ac52530c9ddb4f3e10d282ceb81c1b
Signed-off-by: mirabal <leonardo.mirabal@altran.com>
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 @@
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 @@
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 @@
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']