Example #1
0
 def delete_port_precommit(self, context):
     if not self._check_dev_owner(context):
         return
     net_svc = self.network_client
     resource_group = azure_conf.resource_group
     nic_name = 'nic-' + context.current['id']
     utils.get_nic(net_svc, resource_group, nic_name)
     utils.delete_nic(net_svc, resource_group, nic_name)
     LOG.info("Deleted NIC %s on Azure." % nic_name)
Example #2
0
 def _add_floatingip_to_port(self, port_id, public_ip):
     net_svc = self.network_client
     resource_group = self.resource_group
     nic_name = 'nic-' + port_id
     nic = utils.get_nic(net_svc, resource_group, nic_name)
     nic.ip_configurations[0].public_ip_address = public_ip
     utils.update_nic(net_svc, resource_group, nic_name, nic)