Merge "Get rid of tenant_id in the network commands"

This commit is contained in:
Zuul 2022-01-17 17:39:20 +00:00 committed by Gerrit Code Review
commit f00dce9e2f
39 changed files with 103 additions and 202 deletions

View File

@ -28,9 +28,7 @@ LOG = logging.getLogger(__name__)
def _get_columns(item):
column_map = {
'tenant_id': 'project_id',
}
column_map = {}
hidden_columns = ['location']
return utils.get_osc_show_columns_for_sdk_resource(
item,
@ -56,7 +54,7 @@ def _get_attrs(client_manager, parsed_args):
parsed_args.project,
parsed_args.project_domain,
).id
attrs['tenant_id'] = project_id
attrs['project_id'] = project_id
return attrs

View File

@ -29,7 +29,6 @@ LOG = logging.getLogger(__name__)
def _get_columns(item):
column_map = {
'is_shared': 'shared',
'tenant_id': 'project_id',
}
hidden_columns = ['location']
return utils.get_osc_show_columns_for_sdk_resource(
@ -54,7 +53,7 @@ def _get_attrs(client_manager, parsed_args):
parsed_args.project,
parsed_args.project_domain,
).id
attrs['tenant_id'] = project_id
attrs['project_id'] = project_id
return attrs
@ -220,7 +219,6 @@ class ListAddressScope(command.Lister):
parsed_args.project,
parsed_args.project_domain,
).id
attrs['tenant_id'] = project_id
attrs['project_id'] = project_id
data = client.address_scopes(**attrs)

View File

@ -27,9 +27,7 @@ _formatters = {
def _get_network_columns(item):
column_map = {
'tenant_id': 'project_id',
}
column_map = {}
hidden_columns = ['location']
return utils.get_osc_show_columns_for_sdk_resource(
item,
@ -40,9 +38,6 @@ def _get_network_columns(item):
def _get_columns(item):
columns = list(item.keys())
if 'tenant_id' in columns:
columns.remove('tenant_id')
columns.append('project_id')
return tuple(sorted(columns))
@ -86,7 +81,7 @@ def _get_attrs(client_manager, parsed_args):
parsed_args.project,
parsed_args.project_domain,
).id
attrs['tenant_id'] = project_id
attrs['project_id'] = project_id
if parsed_args.dns_domain:
attrs['dns_domain'] = parsed_args.dns_domain
@ -354,7 +349,6 @@ class ListFloatingIP(common.NetworkAndComputeLister):
parsed_args.project,
parsed_args.project_domain,
)
query['tenant_id'] = project.id
query['project_id'] = project.id
if parsed_args.router is not None:
router = network_client.find_router(parsed_args.router,

View File

@ -26,9 +26,7 @@ LOG = logging.getLogger(__name__)
def _get_columns(item):
column_map = {
'tenant_id': 'project_id',
}
column_map = {}
hidden_columns = ['location']
return utils.get_osc_show_columns_for_sdk_resource(
item,

View File

@ -26,9 +26,7 @@ _formatters = {
def _get_columns(item):
column_map = {
'tenant_id': 'project_id',
}
column_map = {}
hidden_columns = ['location']
return utils.get_osc_show_columns_for_sdk_resource(
item,
@ -89,7 +87,6 @@ class ListIPAvailability(command.Lister):
parsed_args.project,
parsed_args.project_domain,
).id
filters['tenant_id'] = project_id
filters['project_id'] = project_id
data = client.network_ip_availabilities(**filters)
return (column_headers,

View File

@ -58,7 +58,6 @@ def _get_columns_network(item):
'is_shared': 'shared',
'ipv4_address_scope_id': 'ipv4_address_scope',
'ipv6_address_scope_id': 'ipv6_address_scope',
'tenant_id': 'project_id',
'tags': 'tags',
}
hidden_columns = ['location']
@ -70,9 +69,7 @@ def _get_columns_network(item):
def _get_columns_compute(item):
column_map = {
'tenant_id': 'project_id',
}
column_map = {}
return utils.get_osc_show_columns_for_sdk_resource(item, column_map)
@ -101,8 +98,6 @@ def _get_attrs_network(client_manager, parsed_args):
parsed_args.project,
parsed_args.project_domain,
).id
# TODO(dtroyer): Remove tenant_id when we clean up the SDK refactor
attrs['tenant_id'] = project_id
attrs['project_id'] = project_id
# "network set" command doesn't support setting availability zone hints.
@ -573,7 +568,6 @@ class ListNetwork(common.NetworkAndComputeLister):
parsed_args.project,
parsed_args.project_domain,
)
args['tenant_id'] = project.id
args['project_id'] = project.id
if parsed_args.share:

View File

@ -25,9 +25,7 @@ LOG = logging.getLogger(__name__)
def _get_columns(item):
column_map = {
'tenant_id': 'project_id',
}
column_map = {}
hidden_columns = ['location']
return utils.get_osc_show_columns_for_sdk_resource(
item,
@ -56,7 +54,7 @@ def _get_attrs(client_manager, parsed_args):
parsed_args.project,
parsed_args.project_domain,
).id
attrs['tenant_id'] = project_id
attrs['project_id'] = project_id
if parsed_args.check_resources:
attrs['check_resources'] = True

View File

@ -29,7 +29,6 @@ LOG = logging.getLogger(__name__)
def _get_columns(item):
column_map = {
'is_enabled': 'enabled',
'tenant_id': 'project_id',
}
hidden_columns = ['location']
@ -57,7 +56,7 @@ def _get_attrs(client_manager, parsed_args):
parsed_args.project,
parsed_args.project_domain,
).id
attrs['tenant_id'] = project_id
attrs['project_id'] = project_id
return attrs

View File

@ -27,7 +27,6 @@ LOG = logging.getLogger(__name__)
def _get_columns(item):
column_map = {
'is_enabled': 'enabled',
'tenant_id': 'project_id',
}
hidden_columns = ['location']
@ -57,7 +56,7 @@ def _get_attrs(client_manager, parsed_args):
parsed_args.project,
parsed_args.project_domain,
).id
attrs['tenant_id'] = project_id
attrs['project_id'] = project_id
return attrs

View File

@ -29,7 +29,6 @@ LOG = logging.getLogger(__name__)
def _get_columns(item):
column_map = {
'is_shared': 'shared',
'tenant_id': 'project_id',
}
hidden_columns = ['location']
return utils.get_osc_show_columns_for_sdk_resource(
@ -51,7 +50,7 @@ def _get_attrs(client_manager, parsed_args):
parsed_args.project,
parsed_args.project_domain,
).id
attrs['tenant_id'] = project_id
attrs['project_id'] = project_id
if parsed_args.share:
attrs['shared'] = True
if parsed_args.no_share:

View File

@ -27,9 +27,7 @@ LOG = logging.getLogger(__name__)
def _get_columns(item):
column_map = {
'tenant_id': 'project_id',
}
column_map = {}
hidden_columns = ['location']
return utils.get_osc_show_columns_for_sdk_resource(
item,
@ -64,7 +62,7 @@ def _get_attrs(client_manager, parsed_args):
parsed_args.project,
parsed_args.project_domain,
).id
attrs['tenant_id'] = project_id
attrs['project_id'] = project_id
return attrs

View File

@ -29,7 +29,6 @@ LOG = logging.getLogger(__name__)
def _get_columns(item):
column_map = {
'is_shared': 'shared',
'tenant_id': 'project_id',
}
hidden_columns = ['location']
return utils.get_osc_show_columns_for_sdk_resource(
@ -64,7 +63,7 @@ def _get_attrs(client_manager, parsed_args):
parsed_args.project,
parsed_args.project_domain,
).id
attrs['tenant_id'] = project_id
attrs['project_id'] = project_id
return attrs

View File

@ -46,9 +46,7 @@ ACTION_SHOW = 'get'
def _get_columns(item):
column_map = {
'tenant_id': 'project_id',
}
column_map = {}
hidden_columns = ['location']
return utils.get_osc_show_columns_for_sdk_resource(
item,

View File

@ -29,7 +29,6 @@ LOG = logging.getLogger(__name__)
def _get_columns(item):
column_map = {
'target_tenant': 'target_project_id',
'tenant_id': 'project_id',
}
hidden_columns = ['location']
return utils.get_osc_show_columns_for_sdk_resource(
@ -87,7 +86,7 @@ def _get_attrs(client_manager, parsed_args):
parsed_args.project,
parsed_args.project_domain,
).id
attrs['tenant_id'] = project_id
attrs['project_id'] = project_id
return attrs

View File

@ -63,7 +63,6 @@ def _get_columns(item):
'binding:vnic_type': 'binding_vnic_type',
'is_admin_state_up': 'admin_state_up',
'is_port_security_enabled': 'port_security_enabled',
'tenant_id': 'project_id',
}
hidden_columns = ['location']
return utils.get_osc_show_columns_for_sdk_resource(
@ -139,7 +138,7 @@ def _get_attrs(client_manager, parsed_args):
parsed_args.project,
parsed_args.project_domain,
).id
attrs['tenant_id'] = project_id
attrs['project_id'] = project_id
if parsed_args.disable_port_security:
attrs['port_security_enabled'] = False
@ -687,7 +686,6 @@ class ListPort(command.Lister):
parsed_args.project,
parsed_args.project_domain,
).id
filters['tenant_id'] = project_id
filters['project_id'] = project_id
if parsed_args.name:
filters['name'] = parsed_args.name

View File

@ -67,7 +67,6 @@ _formatters = {
def _get_columns(item):
column_map = {
'tenant_id': 'project_id',
'is_ha': 'ha',
'is_distributed': 'distributed',
'is_admin_state_up': 'admin_state_up',
@ -110,7 +109,7 @@ def _get_attrs(client_manager, parsed_args):
parsed_args.project,
parsed_args.project_domain,
).id
attrs['tenant_id'] = project_id
attrs['project_id'] = project_id
if parsed_args.external_gateway:
gateway_info = {}
n_client = client_manager.network
@ -515,7 +514,6 @@ class ListRouter(command.Lister):
parsed_args.project,
parsed_args.project_domain,
).id
args['tenant_id'] = project_id
args['project_id'] = project_id
_tag.get_tag_filtering_args(parsed_args, args)

View File

@ -35,7 +35,6 @@ def _format_network_security_group_rules(sg_rules):
for key in empty_keys:
sg_rule.pop(key)
sg_rule.pop('security_group_id', None)
sg_rule.pop('tenant_id', None)
sg_rule.pop('project_id', None)
return utils.format_list_of_dicts(sg_rules)
@ -85,6 +84,7 @@ _formatters_compute = {
def _get_columns(item):
# We still support Nova managed security groups, where we have tenant_id.
column_map = {
'security_group_rules': 'rules',
'tenant_id': 'project_id',
@ -164,7 +164,7 @@ class CreateSecurityGroup(common.NetworkAndComputeShowOne,
parsed_args.project,
parsed_args.project_domain,
).id
attrs['tenant_id'] = project_id
attrs['project_id'] = project_id
attrs.update(
self._parse_extra_properties(parsed_args.extra_properties))
@ -269,7 +269,6 @@ class ListSecurityGroup(common.NetworkAndComputeLister):
parsed_args.project,
parsed_args.project_domain,
).id
filters['tenant_id'] = project_id
filters['project_id'] = project_id
_tag.get_tag_filtering_args(parsed_args, filters)

View File

@ -71,9 +71,7 @@ def _format_remote_ip_prefix(rule):
def _get_columns(item):
column_map = {
'tenant_id': 'project_id',
}
column_map = {}
hidden_columns = ['location']
return utils.get_osc_show_columns_for_sdk_resource(
item,
@ -357,7 +355,7 @@ class CreateSecurityGroupRule(common.NetworkAndComputeShowOne,
parsed_args.project,
parsed_args.project_domain,
).id
attrs['tenant_id'] = project_id
attrs['project_id'] = project_id
attrs.update(
self._parse_extra_properties(parsed_args.extra_properties))

View File

@ -137,7 +137,6 @@ def _get_columns(item):
column_map = {
'is_dhcp_enabled': 'enable_dhcp',
'subnet_pool_id': 'subnetpool_id',
'tenant_id': 'project_id',
}
# Do not show this column when displaying a subnet
invisible_columns = [
@ -188,7 +187,7 @@ def _get_attrs(client_manager, parsed_args, is_create=True):
parsed_args.project,
parsed_args.project_domain,
).id
attrs['tenant_id'] = project_id
attrs['project_id'] = project_id
attrs['network_id'] = client.find_network(parsed_args.network,
ignore_missing=False).id
if parsed_args.subnet_pool is not None:
@ -522,7 +521,6 @@ class ListSubnet(command.Lister):
parsed_args.project,
parsed_args.project_domain,
).id
filters['tenant_id'] = project_id
filters['project_id'] = project_id
if parsed_args.network:
network_id = network_client.find_network(parsed_args.network,

View File

@ -36,7 +36,6 @@ def _get_columns(item):
'is_shared': 'shared',
'maximum_prefix_length': 'max_prefixlen',
'minimum_prefix_length': 'min_prefixlen',
'tenant_id': 'project_id',
}
hidden_columns = ['location']
return utils.get_osc_show_columns_for_sdk_resource(
@ -91,7 +90,7 @@ def _get_attrs(client_manager, parsed_args):
parsed_args.project,
parsed_args.project_domain,
).id
attrs['tenant_id'] = project_id
attrs['project_id'] = project_id
if parsed_args.description is not None:
attrs['description'] = parsed_args.description
@ -329,7 +328,6 @@ class ListSubnetPool(command.Lister):
parsed_args.project,
parsed_args.project_domain,
).id
filters['tenant_id'] = project_id
filters['project_id'] = project_id
if parsed_args.name is not None:
filters['name'] = parsed_args.name

View File

@ -102,7 +102,7 @@ class FakeAddressGroup(object):
'name': 'address-group-name-' + uuid.uuid4().hex,
'description': 'address-group-description-' + uuid.uuid4().hex,
'id': 'address-group-id-' + uuid.uuid4().hex,
'tenant_id': 'project-id-' + uuid.uuid4().hex,
'project_id': 'project-id-' + uuid.uuid4().hex,
'addresses': ['10.0.0.1/32'],
'location': 'MUNCHMUNCHMUNCH',
}
@ -114,9 +114,6 @@ class FakeAddressGroup(object):
info=copy.deepcopy(address_group_attrs),
loaded=True)
# Set attributes with special mapping in OpenStack SDK.
address_group.project_id = address_group_attrs['tenant_id']
return address_group
@staticmethod
@ -175,7 +172,7 @@ class FakeAddressScope(object):
address_scope_attrs = {
'name': 'address-scope-name-' + uuid.uuid4().hex,
'id': 'address-scope-id-' + uuid.uuid4().hex,
'tenant_id': 'project-id-' + uuid.uuid4().hex,
'project_id': 'project-id-' + uuid.uuid4().hex,
'shared': False,
'ip_version': 4,
'location': 'MUNCHMUNCHMUNCH',
@ -190,7 +187,6 @@ class FakeAddressScope(object):
# Set attributes with special mapping in OpenStack SDK.
address_scope.is_shared = address_scope_attrs['shared']
address_scope.project_id = address_scope_attrs['tenant_id']
return address_scope
@ -241,7 +237,7 @@ class FakeAutoAllocatedTopology(object):
auto_allocated_topology_attrs = {
'id': 'network-id-' + uuid.uuid4().hex,
'tenant_id': 'project-id-' + uuid.uuid4().hex,
'project_id': 'project-id-' + uuid.uuid4().hex,
}
auto_allocated_topology_attrs.update(attrs)
@ -250,10 +246,6 @@ class FakeAutoAllocatedTopology(object):
info=copy.deepcopy(auto_allocated_topology_attrs),
loaded=True)
auto_allocated_topology.project_id = auto_allocated_topology_attrs[
'tenant_id'
]
return auto_allocated_topology
@ -324,7 +316,7 @@ class FakeIPAvailability(object):
network_ip_attrs = {
'network_id': 'network-id-' + uuid.uuid4().hex,
'network_name': 'network-name-' + uuid.uuid4().hex,
'tenant_id': '',
'project_id': '',
'subnet_ip_availability': [],
'total_ips': 254,
'used_ips': 6,
@ -335,7 +327,6 @@ class FakeIPAvailability(object):
network_ip_availability = fakes.FakeResource(
info=copy.deepcopy(network_ip_attrs),
loaded=True)
network_ip_availability.project_id = network_ip_attrs['tenant_id']
return network_ip_availability
@ -412,7 +403,7 @@ class FakeNetwork(object):
'description': 'network-description-' + uuid.uuid4().hex,
'dns_domain': 'example.org.',
'mtu': '1350',
'tenant_id': 'project-id-' + uuid.uuid4().hex,
'project_id': 'project-id-' + uuid.uuid4().hex,
'admin_state_up': True,
'shared': False,
'subnets': ['a', 'b'],
@ -438,7 +429,6 @@ class FakeNetwork(object):
loaded=True)
# Set attributes with special mapping in OpenStack SDK.
network.project_id = network_attrs['tenant_id']
network.is_router_external = network_attrs['router:external']
network.is_admin_state_up = network_attrs['admin_state_up']
network.is_port_security_enabled = \
@ -517,7 +507,7 @@ class FakeNetworkFlavor(object):
'id': 'network-flavor-id-' + fake_uuid,
'name': 'network-flavor-name-' + fake_uuid,
'service_type': 'vpn',
'tenant_id': 'project-id-' + uuid.uuid4().hex,
'project_id': 'project-id-' + uuid.uuid4().hex,
'location': 'MUNCHMUNCHMUNCH',
}
@ -529,7 +519,6 @@ class FakeNetworkFlavor(object):
loaded=True
)
network_flavor.project_id = network_flavor_attrs['tenant_id']
network_flavor.is_enabled = network_flavor_attrs['enabled']
return network_flavor
@ -719,7 +708,7 @@ class FakePort(object):
'port_security_enabled': True,
'security_group_ids': [],
'status': 'ACTIVE',
'tenant_id': 'project-id-' + uuid.uuid4().hex,
'project_id': 'project-id-' + uuid.uuid4().hex,
'qos_network_policy_id': 'qos-policy-id-' + uuid.uuid4().hex,
'qos_policy_id': 'qos-policy-id-' + uuid.uuid4().hex,
'tags': [],
@ -741,11 +730,6 @@ class FakePort(object):
port.binding_vnic_type = port_attrs['binding:vnic_type']
port.is_admin_state_up = port_attrs['admin_state_up']
port.is_port_security_enabled = port_attrs['port_security_enabled']
port.project_id = port_attrs['tenant_id']
port.security_group_ids = port_attrs['security_group_ids']
port.qos_policy_id = port_attrs['qos_policy_id']
port.propagate_uplink_status = port_attrs[
'propagate_uplink_status']
return port
@ -867,7 +851,7 @@ class FakeNetworkRBAC(object):
A dictionary with all attributes
:return:
A FakeResource object, with id, action, target_tenant,
tenant_id, type
project_id, type
"""
attrs = attrs or {}
@ -878,14 +862,13 @@ class FakeNetworkRBAC(object):
'object_id': 'object-id-' + uuid.uuid4().hex,
'action': 'access_as_shared',
'target_tenant': 'target-tenant-' + uuid.uuid4().hex,
'tenant_id': 'tenant-id-' + uuid.uuid4().hex,
'project_id': 'project-id-' + uuid.uuid4().hex,
'location': 'MUNCHMUNCHMUNCH',
}
rbac_attrs.update(attrs)
rbac = fakes.FakeResource(info=copy.deepcopy(rbac_attrs),
loaded=True)
# Set attributes with special mapping in OpenStack SDK.
rbac.project_id = rbac_attrs['tenant_id']
rbac.target_project_id = rbac_attrs['target_tenant']
return rbac
@ -938,7 +921,7 @@ class FakeNetworkFlavorProfile(object):
flavor_profile_attrs = {
'id': 'flavor-profile-id' + uuid.uuid4().hex,
'description': 'flavor-profile-description-' + uuid.uuid4().hex,
'tenant_id': 'project-id-' + uuid.uuid4().hex,
'project_id': 'project-id-' + uuid.uuid4().hex,
'driver': 'driver-' + uuid.uuid4().hex,
'metainfo': 'metainfo-' + uuid.uuid4().hex,
'enabled': True,
@ -951,7 +934,6 @@ class FakeNetworkFlavorProfile(object):
info=copy.deepcopy(flavor_profile_attrs),
loaded=True)
flavor_profile.project_id = flavor_profile_attrs['tenant_id']
flavor_profile.is_enabled = flavor_profile_attrs['enabled']
return flavor_profile
@ -997,7 +979,7 @@ class FakeNetworkQosPolicy(object):
'name': 'qos-policy-name-' + uuid.uuid4().hex,
'id': qos_id,
'is_default': False,
'tenant_id': 'project-id-' + uuid.uuid4().hex,
'project_id': 'project-id-' + uuid.uuid4().hex,
'shared': False,
'description': 'qos-policy-description-' + uuid.uuid4().hex,
'rules': rules,
@ -1013,7 +995,6 @@ class FakeNetworkQosPolicy(object):
# Set attributes with special mapping in OpenStack SDK.
qos_policy.is_shared = qos_policy_attrs['shared']
qos_policy.project_id = qos_policy_attrs['tenant_id']
return qos_policy
@ -1074,7 +1055,7 @@ class FakeNetworkSecGroup(object):
security_group_attrs = {
'name': 'security-group-name-' + uuid.uuid4().hex,
'id': sg_id,
'tenant_id': 'project-id-' + uuid.uuid4().hex,
'project_id': 'project-id-' + uuid.uuid4().hex,
'description': 'security-group-description-' + uuid.uuid4().hex,
'location': 'MUNCHMUNCHMUNCH',
}
@ -1083,9 +1064,6 @@ class FakeNetworkSecGroup(object):
info=copy.deepcopy(security_group_attrs),
loaded=True)
# Set attributes with special mapping in OpenStack SDK.
security_group.project_id = security_group_attrs['tenant_id']
return security_group
@ -1108,7 +1086,7 @@ class FakeNetworkQosRule(object):
qos_rule_attrs = {
'id': 'qos-rule-id-' + uuid.uuid4().hex,
'qos_policy_id': 'qos-policy-id-' + uuid.uuid4().hex,
'tenant_id': 'project-id-' + uuid.uuid4().hex,
'project_id': 'project-id-' + uuid.uuid4().hex,
'type': type,
'location': 'MUNCHMUNCHMUNCH',
}
@ -1128,9 +1106,6 @@ class FakeNetworkQosRule(object):
qos_rule = fakes.FakeResource(info=copy.deepcopy(qos_rule_attrs),
loaded=True)
# Set attributes with special mapping in OpenStack SDK.
qos_rule.project_id = qos_rule['tenant_id']
return qos_rule
@staticmethod
@ -1226,7 +1201,7 @@ class FakeRouter(object):
A dictionary with all attributes
:return:
A FakeResource object, with id, name, admin_state_up,
status, tenant_id
status, project_id
"""
attrs = attrs or {}
@ -1239,7 +1214,7 @@ class FakeRouter(object):
'description': 'router-description-' + uuid.uuid4().hex,
'distributed': False,
'ha': False,
'tenant_id': 'project-id-' + uuid.uuid4().hex,
'project_id': 'project-id-' + uuid.uuid4().hex,
'routes': [],
'external_gateway_info': {},
'availability_zone_hints': [],
@ -1255,7 +1230,6 @@ class FakeRouter(object):
loaded=True)
# Set attributes with special mapping in OpenStack SDK.
router.project_id = router_attrs['tenant_id']
router.is_admin_state_up = router_attrs['admin_state_up']
router.is_distributed = router_attrs['distributed']
router.is_ha = router_attrs['ha']
@ -1332,9 +1306,6 @@ class FakeSecurityGroup(object):
info=copy.deepcopy(security_group_attrs),
loaded=True)
# Set attributes with special mapping in OpenStack SDK.
security_group.project_id = security_group_attrs['project_id']
return security_group
@staticmethod
@ -1403,7 +1374,7 @@ class FakeSecurityGroupRule(object):
'remote_address_group_id': None,
'remote_ip_prefix': '0.0.0.0/0',
'security_group_id': 'security-group-id-' + uuid.uuid4().hex,
'tenant_id': 'project-id-' + uuid.uuid4().hex,
'project_id': 'project-id-' + uuid.uuid4().hex,
'location': 'MUNCHMUNCHMUNCH',
}
@ -1414,9 +1385,6 @@ class FakeSecurityGroupRule(object):
info=copy.deepcopy(security_group_rule_attrs),
loaded=True)
# Set attributes with special mapping in OpenStack SDK.
security_group_rule.project_id = security_group_rule_attrs['tenant_id']
return security_group_rule
@staticmethod
@ -1479,7 +1447,7 @@ class FakeSubnet(object):
'name': 'subnet-name-' + uuid.uuid4().hex,
'network_id': 'network-id-' + uuid.uuid4().hex,
'cidr': '10.10.10.0/24',
'tenant_id': project_id,
'project_id': project_id,
'enable_dhcp': True,
'dns_nameservers': [],
'allocation_pools': [],
@ -1505,7 +1473,6 @@ class FakeSubnet(object):
# Set attributes with special mappings in OpenStack SDK.
subnet.is_dhcp_enabled = subnet_attrs['enable_dhcp']
subnet.subnet_pool_id = subnet_attrs['subnetpool_id']
subnet.project_id = subnet_attrs['tenant_id']
return subnet
@ -1571,7 +1538,7 @@ class FakeFloatingIP(object):
'floating_network_id': 'network-id-' + uuid.uuid4().hex,
'router_id': 'router-id-' + uuid.uuid4().hex,
'port_id': 'port-id-' + uuid.uuid4().hex,
'tenant_id': 'project-id-' + uuid.uuid4().hex,
'project_id': 'project-id-' + uuid.uuid4().hex,
'description': 'floating-ip-description-' + uuid.uuid4().hex,
'qos_policy_id': 'qos-policy-id-' + uuid.uuid4().hex,
'tags': [],
@ -1586,9 +1553,6 @@ class FakeFloatingIP(object):
loaded=True
)
# Set attributes with special mappings in OpenStack SDK.
floating_ip.project_id = floating_ip_attrs['tenant_id']
return floating_ip
@staticmethod
@ -1639,7 +1603,7 @@ class FakeNetworkMeter(object):
'id': 'meter-id-' + uuid.uuid4().hex,
'name': 'meter-name-' + uuid.uuid4().hex,
'description': 'meter-description-' + uuid.uuid4().hex,
'tenant_id': 'project-id-' + uuid.uuid4().hex,
'project_id': 'project-id-' + uuid.uuid4().hex,
'shared': False,
'location': 'MUNCHMUNCHMUNCH',
}
@ -1650,8 +1614,6 @@ class FakeNetworkMeter(object):
info=copy.deepcopy(meter_attrs),
loaded=True)
meter.project_id = meter_attrs['tenant_id']
return meter
@staticmethod
@ -1689,7 +1651,7 @@ class FakeNetworkMeterRule(object):
'remote_ip_prefix': '10.0.0.0/24',
'source_ip_prefix': '8.8.8.8/32',
'destination_ip_prefix': '10.0.0.0/24',
'tenant_id': 'project-id-' + uuid.uuid4().hex,
'project_id': 'project-id-' + uuid.uuid4().hex,
'location': 'MUNCHMUNCHMUNCH',
}
@ -1699,8 +1661,6 @@ class FakeNetworkMeterRule(object):
info=copy.deepcopy(meter_rule_attrs),
loaded=True)
meter_rule.project_id = meter_rule_attrs['tenant_id']
return meter_rule
@staticmethod
@ -1743,7 +1703,7 @@ class FakeSubnetPool(object):
'prefixes': ['10.0.0.0/24', '10.1.0.0/24'],
'default_prefixlen': '8',
'address_scope_id': 'address-scope-id-' + uuid.uuid4().hex,
'tenant_id': 'project-id-' + uuid.uuid4().hex,
'project_id': 'project-id-' + uuid.uuid4().hex,
'is_default': False,
'shared': False,
'max_prefixlen': '32',
@ -1769,7 +1729,6 @@ class FakeSubnetPool(object):
subnet_pool.is_shared = subnet_pool_attrs['shared']
subnet_pool.maximum_prefix_length = subnet_pool_attrs['max_prefixlen']
subnet_pool.minimum_prefix_length = subnet_pool_attrs['min_prefixlen']
subnet_pool.project_id = subnet_pool_attrs['tenant_id']
return subnet_pool

View File

@ -43,7 +43,7 @@ class TestCreateAddressGroup(TestAddressGroup):
new_address_group = (
network_fakes.FakeAddressGroup.create_one_address_group(
attrs={
'tenant_id': project.id,
'project_id': project.id,
}
))
columns = (
@ -122,7 +122,7 @@ class TestCreateAddressGroup(TestAddressGroup):
self.network.create_address_group.assert_called_once_with(**{
'addresses': ['10.0.0.1/32'],
'tenant_id': self.project.id,
'project_id': self.project.id,
'name': self.new_address_group.name,
'description': self.new_address_group.description,
})

View File

@ -43,7 +43,7 @@ class TestCreateAddressScope(TestAddressScope):
new_address_scope = (
network_fakes.FakeAddressScope.create_one_address_scope(
attrs={
'tenant_id': project.id,
'project_id': project.id,
}
))
columns = (
@ -122,7 +122,7 @@ class TestCreateAddressScope(TestAddressScope):
self.network.create_address_scope.assert_called_once_with(**{
'ip_version': self.new_address_scope.ip_version,
'shared': True,
'tenant_id': self.project.id,
'project_id': self.project.id,
'name': self.new_address_scope.name,
})
self.assertEqual(self.columns, columns)
@ -318,7 +318,7 @@ class TestListAddressScope(TestAddressScope):
columns, data = self.cmd.take_action(parsed_args)
self.network.address_scopes.assert_called_once_with(
**{'tenant_id': project.id, 'project_id': project.id})
**{'project_id': project.id})
self.assertEqual(self.columns, columns)
self.assertEqual(self.data, list(data))
@ -335,7 +335,7 @@ class TestListAddressScope(TestAddressScope):
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
columns, data = self.cmd.take_action(parsed_args)
filters = {'tenant_id': project.id, 'project_id': project.id}
filters = {'project_id': project.id}
self.network.address_scopes.assert_called_once_with(**filters)
self.assertEqual(self.columns, columns)

View File

@ -179,7 +179,7 @@ class TestCreateFloatingIPNetwork(TestFloatingIPNetwork):
self.network.create_ip.assert_called_once_with(**{
'floating_network_id': self.floating_ip.floating_network_id,
'tenant_id': project.id,
'project_id': project.id,
})
self.assertEqual(self.columns, columns)
self.assertEqual(self.data, data)
@ -205,7 +205,7 @@ class TestCreateFloatingIPNetwork(TestFloatingIPNetwork):
self.network.create_ip.assert_called_once_with(**{
'floating_network_id': self.floating_ip.floating_network_id,
'tenant_id': project.id,
'project_id': project.id,
})
self.assertEqual(self.columns, columns)
self.assertEqual(self.data, data)
@ -414,7 +414,7 @@ class TestListFloatingIPNetwork(TestFloatingIPNetwork):
ip.fixed_ip_address,
ip.port_id,
ip.floating_network_id,
ip.tenant_id,
ip.project_id,
))
data_long.append((
ip.id,
@ -422,7 +422,7 @@ class TestListFloatingIPNetwork(TestFloatingIPNetwork):
ip.fixed_ip_address,
ip.port_id,
ip.floating_network_id,
ip.tenant_id,
ip.project_id,
ip.router_id,
ip.status,
ip.description,
@ -563,8 +563,7 @@ class TestListFloatingIPNetwork(TestFloatingIPNetwork):
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
columns, data = self.cmd.take_action(parsed_args)
filters = {'tenant_id': project.id,
'project_id': project.id, }
filters = {'project_id': project.id}
self.network.ips.assert_called_once_with(**filters)
@ -584,8 +583,7 @@ class TestListFloatingIPNetwork(TestFloatingIPNetwork):
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
columns, data = self.cmd.take_action(parsed_args)
filters = {'tenant_id': project.id,
'project_id': project.id, }
filters = {'project_id': project.id}
self.network.ips.assert_called_once_with(**filters)
self.assertEqual(self.columns, columns)

View File

@ -39,7 +39,6 @@ class TestFloatingIPPortForwarding(network_fakes.TestNetworkV2):
class TestCreateFloatingIPPortForwarding(TestFloatingIPPortForwarding):
def setUp(self):
project_id = ''
super(TestCreateFloatingIPPortForwarding, self).setUp()
self.new_port_forwarding = (
network_fakes.FakeFloatingIPPortForwarding.
@ -69,7 +68,6 @@ class TestCreateFloatingIPPortForwarding(TestFloatingIPPortForwarding):
'internal_ip_address',
'internal_port',
'internal_port_id',
'project_id',
'protocol'
)
@ -81,7 +79,6 @@ class TestCreateFloatingIPPortForwarding(TestFloatingIPPortForwarding):
self.new_port_forwarding.internal_ip_address,
self.new_port_forwarding.internal_port,
self.new_port_forwarding.internal_port_id,
project_id,
self.new_port_forwarding.protocol,
)
@ -446,12 +443,10 @@ class TestShowFloatingIPPortForwarding(TestFloatingIPPortForwarding):
'internal_ip_address',
'internal_port',
'internal_port_id',
'project_id',
'protocol',
)
def setUp(self):
project_id = ''
super(TestShowFloatingIPPortForwarding, self).setUp()
self._port_forwarding = (
network_fakes.FakeFloatingIPPortForwarding.
@ -469,7 +464,6 @@ class TestShowFloatingIPPortForwarding(TestFloatingIPPortForwarding):
self._port_forwarding.internal_ip_address,
self._port_forwarding.internal_port,
self._port_forwarding.internal_port_id,
project_id,
self._port_forwarding.protocol,
)
self.network.find_floating_ip_port_forwarding = mock.Mock(

View File

@ -106,8 +106,7 @@ class TestListIPAvailability(TestIPAvailability):
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
columns, data = self.cmd.take_action(parsed_args)
filters = {'tenant_id': self.project.id,
'project_id': self.project.id,
filters = {'project_id': self.project.id,
'ip_version': 4}
self.network.network_ip_availabilities.assert_called_once_with(
@ -134,7 +133,7 @@ class TestShowIPAvailability(TestIPAvailability):
data = (
_ip_availability.network_id,
_ip_availability.network_name,
_ip_availability.tenant_id,
_ip_availability.project_id,
format_columns.ListDictColumn(
_ip_availability.subnet_ip_availability),
_ip_availability.total_ips,

View File

@ -48,7 +48,7 @@ class TestCreateNetworkIdentityV3(TestNetwork):
# The new network created.
_network = network_fakes.FakeNetwork.create_one_network(
attrs={
'tenant_id': project.id,
'project_id': project.id,
'availability_zone_hints': ["nova"],
}
)
@ -197,8 +197,6 @@ class TestCreateNetworkIdentityV3(TestNetwork):
'shared': True,
'description': self._network.description,
'mtu': self._network.mtu,
# TODO(dtroyer): Remove tenant_id when we clean up the SDK refactor
'tenant_id': self.project.id,
'project_id': self.project.id,
'is_default': True,
'router:external': True,
@ -284,7 +282,7 @@ class TestCreateNetworkIdentityV2(TestNetwork):
project = identity_fakes_v2.FakeProject.create_one_project()
# The new network created.
_network = network_fakes.FakeNetwork.create_one_network(
attrs={'tenant_id': project.id}
attrs={'project_id': project.id}
)
columns = (
@ -379,8 +377,6 @@ class TestCreateNetworkIdentityV2(TestNetwork):
self.network.create_network.assert_called_once_with(**{
'admin_state_up': True,
'name': self._network.name,
# TODO(dtroyer): Remove tenant_id when we clean up the SDK refactor
'tenant_id': self.project.id,
'project_id': self.project.id,
})
self.assertFalse(self.network.set_tags.called)
@ -704,7 +700,7 @@ class TestListNetwork(TestNetwork):
columns, data = self.cmd.take_action(parsed_args)
self.network.networks.assert_called_once_with(
**{'tenant_id': project.id, 'project_id': project.id}
**{'project_id': project.id}
)
self.assertEqual(self.columns, columns)
@ -723,7 +719,7 @@ class TestListNetwork(TestNetwork):
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
columns, data = self.cmd.take_action(parsed_args)
filters = {'tenant_id': project.id, 'project_id': project.id}
filters = {'project_id': project.id}
self.network.networks.assert_called_once_with(**filters)
self.assertEqual(self.columns, columns)

View File

@ -33,7 +33,7 @@ class TestCreateAutoAllocatedTopology(TestAutoAllocatedTopology):
topology = network_fakes.FakeAutoAllocatedTopology.create_one_topology(
attrs={'id': network_object.id,
'tenant_id': project.id}
'project_id': project.id}
)
columns = (
@ -131,7 +131,7 @@ class TestValidateAutoAllocatedTopology(TestAutoAllocatedTopology):
topology = network_fakes.FakeAutoAllocatedTopology.create_one_topology(
attrs={'id': network_object.id,
'tenant_id': project.id}
'project_id': project.id}
)
columns = (
@ -208,7 +208,7 @@ class TestDeleteAutoAllocatedTopology(TestAutoAllocatedTopology):
topology = network_fakes.FakeAutoAllocatedTopology.create_one_topology(
attrs={'id': network_object.id,
'tenant_id': project.id}
'project_id': project.id}
)
def setUp(self):

View File

@ -166,7 +166,7 @@ class TestCreateNetworkFlavor(TestNetworkFlavor):
self.network.create_flavor.assert_called_once_with(**{
'description': self.new_network_flavor.description,
'enabled': True,
'tenant_id': self.project.id,
'project_id': self.project.id,
'service_type': self.new_network_flavor.service_type,
'name': self.new_network_flavor.name,
})

View File

@ -89,7 +89,7 @@ class TestCreateFlavorProfile(TestFlavorProfile):
self.network.create_service_profile.assert_called_once_with(
**{'description': self.new_flavor_profile.description,
'tenant_id': self.project.id,
'project_id': self.project.id,
'enabled': self.new_flavor_profile.enabled,
'driver': self.new_flavor_profile.driver,
'metainfo': self.new_flavor_profile.metainfo}
@ -119,7 +119,7 @@ class TestCreateFlavorProfile(TestFlavorProfile):
self.network.create_service_profile.assert_called_once_with(
**{'description': self.new_flavor_profile.description,
'tenant_id': self.project.id,
'project_id': self.project.id,
'enabled': self.new_flavor_profile.enabled,
'metainfo': self.new_flavor_profile.metainfo}
)
@ -148,7 +148,7 @@ class TestCreateFlavorProfile(TestFlavorProfile):
self.network.create_service_profile.assert_called_once_with(
**{'description': self.new_flavor_profile.description,
'tenant_id': self.project.id,
'project_id': self.project.id,
'enabled': self.new_flavor_profile.enabled,
'driver': self.new_flavor_profile.driver,
}

View File

@ -112,7 +112,7 @@ class TestCreateMeter(TestMeter):
self.network.create_metering_label.assert_called_once_with(
**{'description': self.new_meter.description,
'name': self.new_meter.name,
'tenant_id': self.project.id,
'project_id': self.project.id,
'shared': True, }
)
self.assertEqual(self.columns, columns)

View File

@ -42,7 +42,7 @@ class TestCreateNetworkQosPolicy(TestQosPolicy):
new_qos_policy = (
network_fakes.FakeNetworkQosPolicy.create_one_qos_policy(
attrs={
'tenant_id': project.id,
'project_id': project.id,
}
))
columns = (
@ -123,7 +123,7 @@ class TestCreateNetworkQosPolicy(TestQosPolicy):
self.network.create_qos_policy.assert_called_once_with(**{
'shared': True,
'tenant_id': self.project.id,
'project_id': self.project.id,
'name': self.new_qos_policy.name,
'description': 'QoS policy description',
'is_default': True,
@ -325,7 +325,7 @@ class TestListNetworkQosPolicy(TestQosPolicy):
columns, data = self.cmd.take_action(parsed_args)
self.network.qos_policies.assert_called_once_with(
**{'tenant_id': project.id}
**{'project_id': project.id}
)
self.assertEqual(self.columns, columns)

View File

@ -45,7 +45,7 @@ class TestCreateNetworkRBAC(TestNetworkRBAC):
ag_object = network_fakes.FakeAddressGroup.create_one_address_group()
project = identity_fakes_v3.FakeProject.create_one_project()
rbac_policy = network_fakes.FakeNetworkRBAC.create_one_network_rbac(
attrs={'tenant_id': project.id,
attrs={'project_id': project.id,
'target_tenant': project.id,
'object_id': network_object.id}
)
@ -64,7 +64,7 @@ class TestCreateNetworkRBAC(TestNetworkRBAC):
rbac_policy.id,
rbac_policy.object_id,
rbac_policy.object_type,
rbac_policy.tenant_id,
rbac_policy.project_id,
rbac_policy.target_tenant,
]
@ -206,7 +206,7 @@ class TestCreateNetworkRBAC(TestNetworkRBAC):
'--type', self.rbac_policy.object_type,
'--action', self.rbac_policy.action,
'--target-project', self.rbac_policy.target_tenant,
'--project', self.rbac_policy.tenant_id,
'--project', self.rbac_policy.project_id,
'--project-domain', self.project.domain_id,
'--target-project-domain', self.project.domain_id,
self.rbac_policy.object_id,
@ -215,7 +215,7 @@ class TestCreateNetworkRBAC(TestNetworkRBAC):
('type', self.rbac_policy.object_type),
('action', self.rbac_policy.action),
('target_project', self.rbac_policy.target_tenant),
('project', self.rbac_policy.tenant_id),
('project', self.rbac_policy.project_id),
('project_domain', self.project.domain_id),
('target_project_domain', self.project.domain_id),
('rbac_object', self.rbac_policy.object_id),
@ -230,7 +230,7 @@ class TestCreateNetworkRBAC(TestNetworkRBAC):
'object_type': self.rbac_policy.object_type,
'action': self.rbac_policy.action,
'target_tenant': self.rbac_policy.target_tenant,
'tenant_id': self.rbac_policy.tenant_id,
'project_id': self.rbac_policy.project_id,
})
self.assertEqual(self.columns, columns)
self.assertEqual(self.data, list(data))
@ -276,7 +276,7 @@ class TestCreateNetworkRBAC(TestNetworkRBAC):
self.rbac_policy.id,
obj_fake.id,
obj_type,
self.rbac_policy.tenant_id,
self.rbac_policy.project_id,
self.rbac_policy.target_tenant,
]
self.assertEqual(self.columns, columns)
@ -541,7 +541,7 @@ class TestShowNetworkRBAC(TestNetworkRBAC):
rbac_policy.id,
rbac_policy.object_id,
rbac_policy.object_type,
rbac_policy.tenant_id,
rbac_policy.project_id,
rbac_policy.target_tenant,
]

View File

@ -1217,7 +1217,6 @@ class TestListPort(TestPort):
columns, data = self.cmd.take_action(parsed_args)
filters = {
'tenant_id': project.id,
'project_id': project.id,
'fields': LIST_FIELDS_TO_RETRIEVE,
}
@ -1241,7 +1240,6 @@ class TestListPort(TestPort):
columns, data = self.cmd.take_action(parsed_args)
filters = {
'tenant_id': project.id,
'project_id': project.id,
'fields': LIST_FIELDS_TO_RETRIEVE,
}

View File

@ -141,7 +141,7 @@ class TestCreateRouter(TestRouter):
new_router.ha,
new_router.id,
new_router.name,
new_router.tenant_id,
new_router.project_id,
router.RoutesColumn(new_router.routes),
new_router.status,
format_columns.ListColumn(new_router.tags),
@ -460,7 +460,7 @@ class TestListRouter(TestRouter):
r.name,
r.status,
router.AdminStateColumn(r.admin_state_up),
r.tenant_id,
r.project_id,
r.distributed,
r.ha,
))
@ -656,7 +656,7 @@ class TestListRouter(TestRouter):
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
columns, data = self.cmd.take_action(parsed_args)
filters = {'tenant_id': project.id, 'project_id': project.id}
filters = {'project_id': project.id}
self.network.routers.assert_called_once_with(**filters)
self.assertEqual(self.columns, columns)
@ -676,7 +676,7 @@ class TestListRouter(TestRouter):
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
columns, data = self.cmd.take_action(parsed_args)
filters = {'tenant_id': project.id, 'project_id': project.id}
filters = {'project_id': project.id}
self.network.routers.assert_called_once_with(**filters)
self.assertEqual(self.columns, columns)
@ -1401,7 +1401,7 @@ class TestShowRouter(TestRouter):
_router.id,
router.RouterInfoColumn(_router.interfaces_info),
_router.name,
_router.tenant_id,
_router.project_id,
router.RoutesColumn(_router.routes),
_router.status,
format_columns.ListColumn(_router.tags),

View File

@ -121,7 +121,7 @@ class TestCreateSecurityGroupNetwork(TestSecurityGroupNetwork):
'description': self._security_group.description,
'stateful': self._security_group.stateful,
'name': self._security_group.name,
'tenant_id': self.project.id,
'project_id': self.project.id,
})
self.assertEqual(self.columns, columns)
self.assertCountEqual(self.data, data)
@ -324,7 +324,7 @@ class TestListSecurityGroupNetwork(TestSecurityGroupNetwork):
columns, data = self.cmd.take_action(parsed_args)
filters = {
'tenant_id': project.id, 'project_id': project.id,
'project_id': project.id,
'fields': security_group.ListSecurityGroup.FIELDS_TO_RETRIEVE}
self.network.security_groups.assert_called_once_with(**filters)
@ -346,7 +346,7 @@ class TestListSecurityGroupNetwork(TestSecurityGroupNetwork):
columns, data = self.cmd.take_action(parsed_args)
filters = {
'tenant_id': project.id, 'project_id': project.id,
'project_id': project.id,
'fields': security_group.ListSecurityGroup.FIELDS_TO_RETRIEVE}
self.network.security_groups.assert_called_once_with(**filters)

View File

@ -458,7 +458,7 @@ class TestCreateSecurityGroupRuleNetwork(TestSecurityGroupRuleNetwork):
'protocol': self._security_group_rule.protocol,
'remote_ip_prefix': self._security_group_rule.remote_ip_prefix,
'security_group_id': self._security_group.id,
'tenant_id': self.project.id,
'project_id': self.project.id,
})
self.assertEqual(self.expected_columns, columns)
self.assertEqual(self.expected_data, data)

View File

@ -44,7 +44,7 @@ class TestCreateSubnet(TestSubnet):
# An IPv4 subnet to be created with mostly default values
self._subnet = network_fakes.FakeSubnet.create_one_subnet(
attrs={
'tenant_id': self.project.id,
'project_id': self.project.id,
}
)
@ -55,7 +55,7 @@ class TestCreateSubnet(TestSubnet):
# An IPv4 subnet to be created using a specific subnet pool
self._subnet_from_pool = network_fakes.FakeSubnet.create_one_subnet(
attrs={
'tenant_id': self.project.id,
'project_id': self.project.id,
'subnetpool_id': self._subnet_pool.id,
'dns_nameservers': ['8.8.8.8',
'8.8.4.4'],
@ -71,7 +71,7 @@ class TestCreateSubnet(TestSubnet):
# An IPv6 subnet to be created with most options specified
self._subnet_ipv6 = network_fakes.FakeSubnet.create_one_subnet(
attrs={
'tenant_id': self.project.id,
'project_id': self.project.id,
'cidr': 'fe80:0:0:a00a::/64',
'enable_dhcp': True,
'dns_nameservers': ['fe80:27ff:a00a:f00f::ffff',
@ -661,7 +661,7 @@ class TestListSubnet(TestSubnet):
subnet.name,
subnet.network_id,
subnet.cidr,
subnet.tenant_id,
subnet.project_id,
subnet.enable_dhcp,
format_columns.ListColumn(subnet.dns_nameservers),
subnet_v2.AllocationPoolsColumn(subnet.allocation_pools),
@ -783,7 +783,7 @@ class TestListSubnet(TestSubnet):
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
columns, data = self.cmd.take_action(parsed_args)
filters = {'tenant_id': project.id, 'project_id': project.id}
filters = {'project_id': project.id}
self.network.subnets.assert_called_once_with(**filters)
self.assertEqual(self.columns, columns)
@ -821,7 +821,7 @@ class TestListSubnet(TestSubnet):
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
columns, data = self.cmd.take_action(parsed_args)
filters = {'tenant_id': project.id, 'project_id': project.id}
filters = {'project_id': project.id}
self.network.subnets.assert_called_once_with(**filters)
self.assertEqual(self.columns, columns)
@ -1247,7 +1247,7 @@ class TestShowSubnet(TestSubnet):
_subnet.ipv6_ra_mode,
_subnet.name,
_subnet.network_id,
_subnet.tenant_id,
_subnet.project_id,
_subnet.segment_id,
format_columns.ListColumn(_subnet.service_types),
_subnet.subnetpool_id,

View File

@ -197,7 +197,7 @@ class TestCreateSubnetPool(TestSubnetPool):
self.network.create_subnet_pool.assert_called_once_with(**{
'prefixes': ['10.0.10.0/24'],
'tenant_id': self.project.id,
'project_id': self.project.id,
'name': self._subnet_pool.name,
})
self.assertEqual(self.columns, columns)
@ -569,7 +569,7 @@ class TestListSubnetPool(TestSubnetPool):
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
columns, data = self.cmd.take_action(parsed_args)
filters = {'tenant_id': project.id, 'project_id': project.id}
filters = {'project_id': project.id}
self.network.subnet_pools.assert_called_once_with(**filters)
self.assertEqual(self.columns, columns)
@ -589,7 +589,7 @@ class TestListSubnetPool(TestSubnetPool):
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
columns, data = self.cmd.take_action(parsed_args)
filters = {'tenant_id': project.id, 'project_id': project.id}
filters = {'project_id': project.id}
self.network.subnet_pools.assert_called_once_with(**filters)
self.assertEqual(self.columns, columns)
@ -970,7 +970,7 @@ class TestShowSubnetPool(TestSubnetPool):
_subnet_pool.min_prefixlen,
_subnet_pool.name,
format_columns.ListColumn(_subnet_pool.prefixes),
_subnet_pool.tenant_id,
_subnet_pool.project_id,
_subnet_pool.shared,
format_columns.ListColumn(_subnet_pool.tags),
)