FLOATINGIP_STATUS_DOWN = 'DOWN'
FLOATINGIP_STATUS_ERROR = 'ERROR'
+DEVICE_OWNER_COMPUTE_PREFIX = "compute:"
+
DEVICE_OWNER_ROUTER_HA_INTF = "network:router_ha_interface"
DEVICE_OWNER_ROUTER_INTF = "network:router_interface"
DEVICE_OWNER_ROUTER_GW = "network:router_gateway"
dvr_serviced_device_owners = (n_const.DEVICE_OWNER_LOADBALANCER,
n_const.DEVICE_OWNER_LOADBALANCERV2,
n_const.DEVICE_OWNER_DHCP)
- return (device_owner.startswith('compute:') or
+ return (device_owner.startswith(n_const.DEVICE_OWNER_COMPUTE_PREFIX) or
device_owner in dvr_serviced_device_owners)
from neutron.agent.linux import dhcp
from neutron.agent.linux import ip_lib
from neutron.agent.linux import utils
+from neutron.common import constants
from neutron.i18n import _LW
DEVICE_OWNER_NETWORK_PROBE = 'network:probe'
-DEVICE_OWNER_COMPUTE_PROBE = 'compute:probe'
+DEVICE_OWNER_COMPUTE_PROBE = constants.DEVICE_OWNER_COMPUTE_PREFIX + 'probe'
class NeutronDebugAgent(object):
def _is_compute_port(self, port):
try:
if (port['device_id'] and uuidutils.is_uuid_like(port['device_id'])
- and port['device_owner'].startswith('compute:')):
+ and port['device_owner'].startswith(
+ constants.DEVICE_OWNER_COMPUTE_PREFIX)):
return True
except (KeyError, AttributeError):
pass
from neutron.agent.linux import iptables_firewall
from neutron.agent import securitygroups_rpc as sg_cfg
+from neutron.common import constants
from neutron.tests.common import machine_fixtures
from neutron.tests.common import net_helpers
from neutron.tests.functional import base
from oslo_config import cfg
+DEVICE_OWNER_COMPUTE = constants.DEVICE_OWNER_COMPUTE_PREFIX + 'fake'
+
class IptablesFirewallTestCase(base.BaseSudoTestCase):
MAC_REAL = "fa:16:3e:9a:2f:49"
self.client.port.name)
self.src_port_desc = {'admin_state_up': True,
'device': client_br_port_name,
- 'device_owner': 'compute:None',
+ 'device_owner': DEVICE_OWNER_COMPUTE,
'fixed_ips': [self.client.ip],
'mac_address': self.MAC_REAL,
'port_security_enabled': True,
METADATA_REQUEST_TIMEOUT = 60
METADATA_REQUEST_SLEEP = 5
+DEVICE_OWNER_COMPUTE = l3_constants.DEVICE_OWNER_COMPUTE_PREFIX + 'fake'
+
def get_ovs_bridge(br_name):
return ovs_lib.OVSBridge(br_name)
port_data = {
'fixed_ips': [{'ip_address': expected_neighbor}],
'mac_address': 'fa:3e:aa:bb:cc:dd',
- 'device_owner': 'compute:None'
+ 'device_owner': DEVICE_OWNER_COMPUTE
}
self.agent.plugin_rpc.get_ports_by_subnet.return_value = [port_data]
router1 = self.manage_router(self.agent, router_info)
import mock
from neutron.api.v2 import attributes
-from neutron.common import constants as l3_const
+from neutron.common import constants
from neutron.extensions import external_net
from neutron.tests.common import helpers
from neutron.tests.unit.plugins.ml2 import base as ml2_test_base
+DEVICE_OWNER_COMPUTE = constants.DEVICE_OWNER_COMPUTE_PREFIX + 'fake'
+
+
class L3DvrTestCase(ml2_test_base.ML2TestFramework):
def setUp(self):
super(L3DvrTestCase, self).setUp()
self.l3_agent = helpers.register_l3_agent(
- agent_mode=l3_const.L3_AGENT_MODE_DVR_SNAT)
+ agent_mode=constants.L3_AGENT_MODE_DVR_SNAT)
def _create_router(self, distributed=True):
return (super(L3DvrTestCase, self).
def test_get_device_owner_distributed_router_object(self):
router = self._create_router()
self.assertEqual(
- l3_const.DEVICE_OWNER_DVR_INTERFACE,
+ constants.DEVICE_OWNER_DVR_INTERFACE,
self.l3_plugin._get_device_owner(self.context, router))
def test_get_device_owner_distributed_router_id(self):
router = self._create_router()
self.assertEqual(
- l3_const.DEVICE_OWNER_DVR_INTERFACE,
+ constants.DEVICE_OWNER_DVR_INTERFACE,
self.l3_plugin._get_device_owner(self.context, router['id']))
def test_get_device_owner_centralized(self):
router = self._create_router(distributed=False)
self.assertEqual(
- l3_const.DEVICE_OWNER_ROUTER_INTF,
+ constants.DEVICE_OWNER_ROUTER_INTF,
self.l3_plugin._get_device_owner(self.context, router['id']))
def test_get_agent_gw_ports_exist_for_network_no_port(self):
self.context, filters={
'network_id': [subnet1['subnet']['network_id']],
'device_owner':
- [l3_const.DEVICE_OWNER_DVR_INTERFACE]})[0]
+ [constants.DEVICE_OWNER_DVR_INTERFACE]})[0]
self.l3_plugin.remove_router_interface(
self.context, router['id'],
{'port_id': port['id']})
'mac_address': attributes.ATTR_NOT_SPECIFIED,
'fixed_ips': attributes.ATTR_NOT_SPECIFIED,
'device_id': self.l3_agent['id'],
- 'device_owner': l3_const.DEVICE_OWNER_AGENT_GW,
+ 'device_owner': constants.DEVICE_OWNER_AGENT_GW,
'binding:host_id': '',
'admin_state_up': True,
'name': ''}})
with self.subnet() as ext_subnet,\
self.subnet(cidr='20.0.0.0/24') as int_subnet,\
self.port(subnet=int_subnet,
- device_owner='compute:None') as int_port:
+ device_owner=DEVICE_OWNER_COMPUTE) as int_port:
# make net external
ext_net_id = ext_subnet['subnet']['network_id']
self._update('networks', ext_net_id,
self.subnet(cidr='20.0.0.0/24') as int_subnet1,\
self.subnet(cidr='30.0.0.0/24') as int_subnet2,\
self.port(subnet=int_subnet1,
- device_owner='compute:None') as int_port1,\
+ device_owner=DEVICE_OWNER_COMPUTE) as int_port1,\
self.port(subnet=int_subnet2,
- device_owner='compute:None') as int_port2:
+ device_owner=DEVICE_OWNER_COMPUTE) as int_port2:
# locate internal ports on different hosts
self.core_plugin.update_port(
self.context, int_port1['port']['id'],
{'port': {'binding:host_id': 'host2'}})
# and create l3 agents on corresponding hosts
helpers.register_l3_agent(host='host1',
- agent_mode=l3_const.L3_AGENT_MODE_DVR)
+ agent_mode=constants.L3_AGENT_MODE_DVR)
helpers.register_l3_agent(host='host2',
- agent_mode=l3_const.L3_AGENT_MODE_DVR)
+ agent_mode=constants.L3_AGENT_MODE_DVR)
# make net external
ext_net_id = ext_subnet['subnet']['network_id']
with self.subnet() as ext_subnet,\
self.subnet(cidr='20.0.0.0/24') as int_subnet,\
self.port(subnet=int_subnet,
- device_owner='compute:None') as int_port:
+ device_owner=DEVICE_OWNER_COMPUTE) as int_port:
# make net external
ext_net_id = ext_subnet['subnet']['network_id']
self._update('networks', ext_net_id,
# register l3 agent in dvr mode in addition to existing dvr_snat agent
HOST = 'host1'
dvr_agent = helpers.register_l3_agent(
- host=HOST, agent_mode=l3_const.L3_AGENT_MODE_DVR)
+ host=HOST, agent_mode=constants.L3_AGENT_MODE_DVR)
router = self._create_router()
with self.subnet() as subnet:
self.l3_plugin.add_router_interface(
with mock.patch.object(self.l3_plugin,
'_l3_rpc_notifier') as l3_notifier,\
self.port(subnet=subnet,
- device_owner='compute:None') as port:
+ device_owner=DEVICE_OWNER_COMPUTE) as port:
self.core_plugin.update_port(
self.context, port['port']['id'],
{'port': {'binding:host_id': HOST}})
self._test_is_dvr_serviced(constants.DEVICE_OWNER_DHCP, True)
def test_is_dvr_serviced_with_vm_port(self):
- self._test_is_dvr_serviced('compute:', True)
+ self._test_is_dvr_serviced(constants.DEVICE_OWNER_COMPUTE_PREFIX, True)
class TestIpToCidr(base.BaseTestCase):
L3_HOSTB = 'hostb'
DHCP_HOSTC = 'hostc'
+DEVICE_OWNER_COMPUTE = ''.join([constants.DEVICE_OWNER_COMPUTE_PREFIX,
+ 'test:',
+ DHCP_HOSTA])
+
class AgentSchedulerTestMixIn(object):
result0 = len(dhcp_agents['agents'])
self._register_agent_states()
with self.port(subnet=subnet,
- device_owner="compute:test:" + DHCP_HOSTA) as port:
+ device_owner=DEVICE_OWNER_COMPUTE) as port:
dhcp_agents = self._list_dhcp_agents_hosting_network(
port['port']['network_id'])
result1 = len(dhcp_agents['agents'])
result0 = len(dhcp_agents['agents'])
self._register_agent_states()
with self.port(subnet=subnet,
- device_owner="compute:test:" + DHCP_HOSTA) as port:
+ device_owner=DEVICE_OWNER_COMPUTE) as port:
dhcp_agents = self._list_dhcp_agents_hosting_network(
port['port']['network_id'])
result1 = len(dhcp_agents['agents'])
result0 = len(dhcp_agents['agents'])
self._register_agent_states()
with self.port(subnet=subnet,
- device_owner="compute:test:" + DHCP_HOSTA) as port:
+ device_owner=DEVICE_OWNER_COMPUTE) as port:
dhcp_agents = self._list_dhcp_agents_hosting_network(
port['port']['network_id'])
result1 = len(dhcp_agents['agents'])
helpers.register_dhcp_agent('host1')
with self.port(subnet=subnet,
- device_owner="compute:test:" + DHCP_HOSTA) as port:
+ device_owner=DEVICE_OWNER_COMPUTE) as port:
dhcp_agents = self._list_dhcp_agents_hosting_network(
port['port']['network_id'])
result2 = len(dhcp_agents['agents'])
DB_PLUGIN_KLASS = 'neutron.db.db_base_plugin_v2.NeutronDbPluginV2'
-DEVICE_OWNER_COMPUTE = 'compute:None'
+DEVICE_OWNER_COMPUTE = constants.DEVICE_OWNER_COMPUTE_PREFIX + 'fake'
DEVICE_OWNER_NOT_COMPUTE = constants.DEVICE_OWNER_DHCP
_get_path = test_base._get_path
+DEVICE_OWNER_COMPUTE = l3_constants.DEVICE_OWNER_COMPUTE_PREFIX + 'fake'
+
+
class L3TestExtensionManager(object):
def get_resources(self):
port_id = 'foo_port_id'
port = {
'id': port_id,
- 'device_owner': 'compute:None',
+ 'device_owner': DEVICE_OWNER_COMPUTE,
portbindings.HOST_ID: '',
portbindings.VIF_TYPE: portbindings.VIF_TYPE_BINDING_FAILED
}
tenant_id=self.tenant_id,
admin_state_up=True,
device_id='something',
- device_owner='compute:nova',
+ device_owner=constants.DEVICE_OWNER_COMPUTE_PREFIX + 'nova',
status=constants.PORT_STATUS_ACTIVE,
mac_address=FAKE_FIP_INT_PORT_MAC,
network_id=self.int_net_id)
from oslo_config import cfg
-from neutron.common import constants
+from neutron.common import constants as n_const
from neutron.db import models_v2
from neutron.notifiers import nova
from neutron.tests import base
+DEVICE_OWNER_COMPUTE = n_const.DEVICE_OWNER_COMPUTE_PREFIX + 'fake'
+
class TestNovaNotify(base.BaseTestCase):
def setUp(self, plugin=None):
def get_port(self, context, port_id):
device_id = '32102d7b-1cf4-404d-b50a-97aae1f55f87'
return {'device_id': device_id,
- 'device_owner': 'compute:None'}
+ 'device_owner': DEVICE_OWNER_COMPUTE}
self.nova_notifier = nova.Notifier()
self.nova_notifier._plugin_ref = FakePlugin()
def test_notify_port_status_all_values(self):
- states = [constants.PORT_STATUS_ACTIVE, constants.PORT_STATUS_DOWN,
- constants.PORT_STATUS_ERROR, constants.PORT_STATUS_BUILD,
+ states = [n_const.PORT_STATUS_ACTIVE, n_const.PORT_STATUS_DOWN,
+ n_const.PORT_STATUS_ERROR, n_const.PORT_STATUS_BUILD,
sql_attr.NO_VALUE]
device_id = '32102d7b-1cf4-404d-b50a-97aae1f55f87'
# test all combinations
for current_port_status in states:
port = models_v2.Port(id='port-uuid', device_id=device_id,
- device_owner="compute:",
+ device_owner=DEVICE_OWNER_COMPUTE,
status=current_port_status)
self._record_port_status_changed_helper(current_port_status,
previous_port_status,
def test_port_without_uuid_device_id_no_notify(self):
port = models_v2.Port(id='port-uuid', device_id='compute_probe:',
- device_owner='compute:',
- status=constants.PORT_STATUS_ACTIVE)
- self._record_port_status_changed_helper(constants.PORT_STATUS_ACTIVE,
+ device_owner=DEVICE_OWNER_COMPUTE,
+ status=n_const.PORT_STATUS_ACTIVE)
+ self._record_port_status_changed_helper(n_const.PORT_STATUS_ACTIVE,
sql_attr.NO_VALUE,
port)
def test_port_without_device_owner_no_notify(self):
device_id = '32102d7b-1cf4-404d-b50a-97aae1f55f87'
port = models_v2.Port(id='port-uuid', device_id=device_id,
- status=constants.PORT_STATUS_ACTIVE)
- self._record_port_status_changed_helper(constants.PORT_STATUS_ACTIVE,
+ status=n_const.PORT_STATUS_ACTIVE)
+ self._record_port_status_changed_helper(n_const.PORT_STATUS_ACTIVE,
sql_attr.NO_VALUE,
port)
def test_port_without_device_id_no_notify(self):
port = models_v2.Port(id='port-uuid', device_owner="network:dhcp",
- status=constants.PORT_STATUS_ACTIVE)
- self._record_port_status_changed_helper(constants.PORT_STATUS_ACTIVE,
+ status=n_const.PORT_STATUS_ACTIVE)
+ self._record_port_status_changed_helper(n_const.PORT_STATUS_ACTIVE,
sql_attr.NO_VALUE,
port)
def test_port_without_id_no_notify(self):
device_id = '32102d7b-1cf4-404d-b50a-97aae1f55f87'
port = models_v2.Port(device_id=device_id,
- device_owner="compute:",
- status=constants.PORT_STATUS_ACTIVE)
- self._record_port_status_changed_helper(constants.PORT_STATUS_ACTIVE,
+ device_owner=DEVICE_OWNER_COMPUTE,
+ status=n_const.PORT_STATUS_ACTIVE)
+ self._record_port_status_changed_helper(n_const.PORT_STATUS_ACTIVE,
sql_attr.NO_VALUE,
port)
device_id = '32102d7b-1cf4-404d-b50a-97aae1f55f87'
port = models_v2.Port(id='port-uuid', device_id=device_id,
device_owner="network:dhcp",
- status=constants.PORT_STATUS_ACTIVE)
- self._record_port_status_changed_helper(constants.PORT_STATUS_ACTIVE,
+ status=n_const.PORT_STATUS_ACTIVE)
+ self._record_port_status_changed_helper(n_const.PORT_STATUS_ACTIVE,
sql_attr.NO_VALUE,
port)
previous_port_status, port):
if not (port.device_id and port.id and port.device_owner and
- port.device_owner.startswith('compute:') and
+ port.device_owner.startswith(
+ n_const.DEVICE_OWNER_COMPUTE_PREFIX) and
uuidutils.is_uuid_like(port.device_id)):
return
- if (previous_port_status == constants.PORT_STATUS_ACTIVE and
- current_port_status == constants.PORT_STATUS_DOWN):
+ if (previous_port_status == n_const.PORT_STATUS_ACTIVE and
+ current_port_status == n_const.PORT_STATUS_DOWN):
event_name = nova.VIF_UNPLUGGED
elif (previous_port_status in [sql_attr.NO_VALUE,
- constants.PORT_STATUS_DOWN,
- constants.PORT_STATUS_BUILD]
- and current_port_status in [constants.PORT_STATUS_ACTIVE,
- constants.PORT_STATUS_ERROR]):
+ n_const.PORT_STATUS_DOWN,
+ n_const.PORT_STATUS_BUILD]
+ and current_port_status in [n_const.PORT_STATUS_ACTIVE,
+ n_const.PORT_STATUS_ERROR]):
event_name = nova.VIF_PLUGGED
else:
def test_update_fixed_ip_changed(self):
device_id = '32102d7b-1cf4-404d-b50a-97aae1f55f87'
returned_obj = {'port':
- {'device_owner': u'compute:dfd',
+ {'device_owner': DEVICE_OWNER_COMPUTE,
'id': u'bee50827-bcee-4cc8-91c1-a27b0ce54222',
'device_id': device_id}}
device_id = '32102d7b-1cf4-404d-b50a-97aae1f55f87'
port_id = 'bee50827-bcee-4cc8-91c1-a27b0ce54222'
returned_obj = {'port':
- {'device_owner': 'compute:dfd',
+ {'device_owner': DEVICE_OWNER_COMPUTE,
'id': port_id,
'device_id': device_id}}
POLICY_ID_A = 'policy-id-a'
POLICY_ID_B = 'policy-id-b'
-DEVICE_OWNER_COMPUTE = 'compute:None'
+DEVICE_OWNER_COMPUTE = constants.DEVICE_OWNER_COMPUTE_PREFIX + 'fake'
class QosRuleObjectTestCase(neutron_test_base.BaseTestCase):
NOTIFIER = 'neutron.plugins.ml2.rpc.AgentNotifierApi'
-DEVICE_OWNER_COMPUTE = 'compute:None'
+DEVICE_OWNER_COMPUTE = constants.DEVICE_OWNER_COMPUTE_PREFIX + 'fake'
class TestL2PopulationRpcTestCase(test_plugin.Ml2PluginV2TestCase):
def test_update_port_precommit_mac_address_changed_raises(self):
port = {'status': u'ACTIVE',
- 'device_owner': u'compute:None',
+ 'device_owner': DEVICE_OWNER_COMPUTE,
'mac_address': u'12:34:56:78:4b:0e',
'id': u'1'}
TEST_NETWORK_ID1 = 'net-id-1'
TEST_NETWORK_ID2 = 'net-id-2'
+DEVICE_OWNER_COMPUTE = n_const.DEVICE_OWNER_COMPUTE_PREFIX + 'fake'
+
class FakeVif(object):
ofport = 99
int_br.set_db_attribute.return_value = True
needs_binding = self.agent.port_bound(
port, net_uuid, 'local', None, None,
- fixed_ips, "compute:None", False)
+ fixed_ips, DEVICE_OWNER_COMPUTE, False)
if db_get_val is None:
self.assertEqual(0, int_br.set_db_attribute.call_count)
self.assertFalse(needs_binding)
'network_type': 'baz',
'fixed_ips': [{'subnet_id': 'my-subnet-uuid',
'ip_address': '1.1.1.1'}],
- 'device_owner': 'compute:None',
+ 'device_owner': DEVICE_OWNER_COMPUTE,
'port_security_enabled': True
}
def test_port_bound_for_dvr_with_compute_ports(self):
self._test_port_bound_for_dvr_on_vlan_network(
- device_owner="compute:None")
+ device_owner=DEVICE_OWNER_COMPUTE)
self._test_port_bound_for_dvr_on_vlan_network(
- device_owner="compute:None", ip_version=6)
+ device_owner=DEVICE_OWNER_COMPUTE, ip_version=6)
self._test_port_bound_for_dvr_on_vxlan_network(
- device_owner="compute:None")
+ device_owner=DEVICE_OWNER_COMPUTE)
self._test_port_bound_for_dvr_on_vxlan_network(
- device_owner="compute:None", ip_version=6)
+ device_owner=DEVICE_OWNER_COMPUTE, ip_version=6)
def test_port_bound_for_dvr_with_lbaas_vip_ports(self):
self._test_port_bound_for_dvr_on_vlan_network(
def test_treat_devices_removed_for_dvr_with_compute_ports(self):
self._test_treat_devices_removed_for_dvr(
- device_owner="compute:None")
+ device_owner=DEVICE_OWNER_COMPUTE)
self._test_treat_devices_removed_for_dvr(
- device_owner="compute:None", ip_version=6)
+ device_owner=DEVICE_OWNER_COMPUTE, ip_version=6)
def test_treat_devices_removed_for_dvr_with_lbaas_vip_ports(self):
self._test_treat_devices_removed_for_dvr(
from neutron.agent.common import ovs_lib
from neutron.agent.linux import ip_lib
+from neutron.common import constants as n_const
from neutron.plugins.common import constants as p_const
from neutron.plugins.ml2.drivers.openvswitch.agent.common import constants
from neutron.tests.unit.plugins.ml2.drivers.openvswitch.agent \
VIF_PORTS = {VIF_ID: VIF_PORT}
FIXED_IPS = [{'subnet_id': 'my-subnet-uuid',
'ip_address': '1.1.1.1'}]
-VM_DEVICE_OWNER = "compute:None"
+VM_DEVICE_OWNER = n_const.DEVICE_OWNER_COMPUTE_PREFIX + 'fake'
TUN_OFPORTS = {p_const.TYPE_GRE: {'ip1': '11', 'ip2': '12'}}
PLUGIN_NAME = 'neutron.plugins.ml2.plugin.Ml2Plugin'
-DEVICE_OWNER_COMPUTE = 'compute:None'
+DEVICE_OWNER_COMPUTE = constants.DEVICE_OWNER_COMPUTE_PREFIX + 'fake'
HOST = 'fake_host'
self.assertTrue(notify.call_counts)
def test_check_if_compute_port_serviced_by_dvr(self):
- self.assertTrue(utils.is_dvr_serviced('compute:None'))
+ self.assertTrue(utils.is_dvr_serviced(DEVICE_OWNER_COMPUTE))
def test_check_if_lbaas_vip_port_serviced_by_dvr(self):
self.assertTrue(utils.is_dvr_serviced(
port['port']['id'])
def test_delete_last_vm_port(self):
- self._test_delete_dvr_serviced_port(device_owner='compute:None')
+ self._test_delete_dvr_serviced_port(device_owner=DEVICE_OWNER_COMPUTE)
def test_delete_last_vm_port_with_floatingip(self):
- self._test_delete_dvr_serviced_port(device_owner='compute:None',
+ self._test_delete_dvr_serviced_port(device_owner=DEVICE_OWNER_COMPUTE,
floating_ip=True)
def test_delete_lbaas_vip_port(self):
admin_state_up=True,
status='ACTIVE',
device_id='vm_id',
- device_owner='compute:None')
+ device_owner=DEVICE_OWNER_COMPUTE)
binding = mock.Mock()
binding.port_id = port_id
HOST_DVR = 'my_l3_host_dvr'
HOST_DVR_SNAT = 'my_l3_host_dvr_snat'
+DEVICE_OWNER_COMPUTE = constants.DEVICE_OWNER_COMPUTE_PREFIX + 'fake'
+DEVICE_OWNER_COMPUTE_NOVA = constants.DEVICE_OWNER_COMPUTE_PREFIX + 'nova'
class FakeL3Scheduler(l3_agent_scheduler.L3Scheduler):
# matching subnet
port = {'subnet_id': str(uuid.uuid4()),
'binding:host_id': 'host_1',
- 'device_owner': 'compute:',
+ 'device_owner': constants.DEVICE_OWNER_COMPUTE_PREFIX,
'id': 1234}
subnet = {'id': str(uuid.uuid4()),
'enable_dhcp': False}
'id': port_id,
'binding:host_id': 'vm-host',
'device_id': 'vm-id',
- 'device_owner': 'compute:None',
+ 'device_owner': DEVICE_OWNER_COMPUTE,
'mac_address': '02:04:05:17:18:19'
},
'mac_address_updated': True
'id': port_id,
'binding:host_id': 'vm-host',
'device_id': 'vm-id',
- 'device_owner': 'compute:None'
+ 'device_owner': DEVICE_OWNER_COMPUTE
}
}
port = {
'id': 'port1',
'device_id': 'abcd',
- 'device_owner': 'compute:nova',
+ 'device_owner': DEVICE_OWNER_COMPUTE_NOVA,
'binding:host_id': 'host1',
'fixed_ips': [
{
'device_id': 'r1',
'status': port_status,
'binding:host_id': 'thisHost',
- 'device_owner': 'compute:nova',
+ 'device_owner': DEVICE_OWNER_COMPUTE_NOVA,
'fixed_ips': [
{
'subnet_id': '80947d4a-fbc8-484b-9f92-623a6bfcf3e0',
def _create_port(self, port_name, tenant_id, host, subnet_id, ip_address,
status='ACTIVE',
- device_owner='compute:nova'):
+ device_owner=DEVICE_OWNER_COMPUTE_NOVA):
return {
'id': port_name + '-port-id',
'tenant_id': tenant_id,