__author__ = "Alfonso Tierno, Leonardo Mirabal"
__date__ = "$06-Feb-2017 12:07:15$"
-__version__ = "0.5.18-r534"
-version_date = "Jun 2017"
-database_version = 21 #needed database schema version
+__version__ = "0.5.22-r538"
+version_date = "Nov 2017"
+database_version = 22 #needed database schema version
HTTP_Bad_Request = 400
HTTP_Unauthorized = 401
network['vlan'] = net_vlan
network['region'] = net_region
dhcp_integrity = True
- if 'enable_dhcp' in network and network['enable_dhcp']:
+ if network.get('enable_dhcp'):
dhcp_integrity = self._check_dhcp_data_integrity(network)
if network.get('links'):
network['routes'] = yaml.safe_dump(network['routes'], default_flow_style=True, width=256)
result, content = self.db.new_row('nets', network, True, True)
- if result >= 0 and dhcp_integrity:
+ if result >= 0: # and dhcp_integrity:
if bridge_net:
bridge_net[3] = content
- if self.config.get("dhcp_server") and self.config['network_type'] == 'bridge': # \
+ if self.config.get("dhcp_server") and self.config['network_type'] == 'bridge':
if network["name"] in self.config["dhcp_server"].get("nets", ()):
self.config["dhcp_nets"].append(content)
self.logger.debug("dhcp_server: add new net", content)
self.logger.debug("dhcp_server: add new net", content, content)
return content
else:
- raise ovimException("Error posting network", HTTP_Internal_Server_Error)
+ raise ovimException("Error creating network: {}".format(content), -result)
+
# TODO kei change update->edit
def edit_network(self, network_id, network):
map['switch_dpid'] = switch_dpid
if region:
map['region'] = region
+ if map.get("pci"):
+ map["pci"] = map["pci"].lower()
for of_map in of_maps:
result, uuid = self.db.new_row('of_port_mappings', of_map, True)