X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=ovim.py;h=31669724eb0b10f04818ff5aa22b15cebec057b1;hb=refs%2Fchanges%2F87%2F1387%2F3;hp=f896adc6a725e5e778fc5d86991cd47211cb05ee;hpb=2db743baaa4e14e758fbdfdb7a2db0f8d0e91853;p=osm%2Fopenvim.git diff --git a/ovim.py b/ovim.py index f896adc..3166972 100644 --- a/ovim.py +++ b/ovim.py @@ -900,9 +900,12 @@ class ovim(): port_data['switch_mac'] = port_mapping_data[0]['switch_mac'] # remove from compute_node, region and pci of_port_data to adapt to 'ports' structure - del port_data['compute_node'] - del port_data['region'] - del port_data['pci'] + if 'region' in port_data: + del port_data['region'] + if 'pci' in port_data: + del port_data['pci'] + if 'compute_node' in port_data: + del port_data['compute_node'] result, uuid = self.db.new_row('ports', port_data, True, True) if result > 0: