Exemplo n.º 1
0
 def test_remove_neutron_ports(self):
     with task_manager.acquire(self.context, self.node.uuid) as task:
         self.client_mock.list_ports.return_value = {
             'ports': [self.neutron_port]}
         neutron.remove_neutron_ports(task, {'param': 'value'})
     self.client_mock.list_ports.assert_called_once_with(
         **{'param': 'value'})
     self.client_mock.delete_port.assert_called_once_with(
         self.neutron_port['id'])
Exemplo n.º 2
0
    def unconfigure_tenant_networks(self, task):
        """Unconfigure tenant networks for a node.

        Even though nova takes care of port removal from tenant network, we
        remove it here/now to avoid the possibility of the ironic port being
        bound to the tenant and cleaning networks at the same time.

        :param task: A TaskManager instance.
        :raises: NetworkError
        """
        node = task.node
        LOG.info(_LI('Unmapping instance ports from node %s'), node.uuid)
        params = {'device_id': node.instance_uuid or node.uuid}

        neutron.remove_neutron_ports(task, params)
Exemplo n.º 3
0
    def unconfigure_tenant_networks(self, task):
        """Unconfigure tenant networks for a node.

        Even though nova takes care of port removal from tenant network, we
        remove it here/now to avoid the possibility of the ironic port being
        bound to the tenant and cleaning networks at the same time.

        :param task: A TaskManager instance.
        :raises: NetworkError
        """
        node = task.node
        LOG.info(_LI('Unmapping instance ports from node %s'), node.uuid)
        params = {'device_id': node.instance_uuid or node.uuid}

        neutron.remove_neutron_ports(task, params)