+ #Delete any attached port to this sdn network
+ #At this point, there will be ports associated to this network in case it was manually done using 'openmano vim-net-sdn-attach'
+ try:
+ port_list = self.ovim.get_ports(columns={'uuid'}, filter={'name': 'external_port', 'net_id': sdn_net_id})
+ except ovimException as e:
+ raise vimconn.vimconnException(
+ "ovimException obtaining external ports for net {}. ".format(sdn_net_id) + str(e))
+
+ for port in port_list:
+ try:
+ self.ovim.delete_port(port['uuid'])
+ except ovimException as e:
+ raise vimconn.vimconnException(
+ "ovimException deleting port {} for net {}. ".format(port['uuid'], sdn_net_id) + str(e))