Blackify openstack.network

We disable the H301 check since it clashes with black.

Black used with the '-l 79 -S' flags.

A future change will ignore this commit in git-blame history by adding a
'git-blame-ignore-revs' file.

Change-Id: Ib987ac513c4f5e527bf4122b784d0a69856b903e
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
This commit is contained in:
Stephen Finucane 2023-05-03 12:07:08 +01:00
parent bcf99f3433
commit f526b990f3
125 changed files with 3129 additions and 1868 deletions

View File

@ -18,12 +18,23 @@ class NetworkResource(resource.Resource):
_allow_unknown_attrs_in_body = True
def _prepare_request(self, requires_id=None, prepend_key=False,
patch=False, base_path=None, params=None,
if_revision=None, **kwargs):
def _prepare_request(
self,
requires_id=None,
prepend_key=False,
patch=False,
base_path=None,
params=None,
if_revision=None,
**kwargs
):
req = super(NetworkResource, self)._prepare_request(
requires_id=requires_id, prepend_key=prepend_key, patch=patch,
base_path=base_path, params=params)
requires_id=requires_id,
prepend_key=prepend_key,
patch=patch,
base_path=base_path,
params=params,
)
if if_revision is not None:
req.headers['If-Match'] = "revision_number=%d" % if_revision
return req

File diff suppressed because it is too large Load Diff

View File

@ -17,6 +17,7 @@ from openstack import utils
class AddressGroup(resource.Resource):
"""Address group extension."""
resource_key = 'address_group'
resources_key = 'address_groups'
base_path = '/address-groups'
@ -31,9 +32,11 @@ class AddressGroup(resource.Resource):
_allow_unknown_attrs_in_body = True
_query_mapping = resource.QueryParameters(
"sort_key", "sort_dir",
'name', 'description',
'project_id'
"sort_key",
"sort_dir",
'name',
'description',
'project_id',
)
# Properties

View File

@ -15,6 +15,7 @@ from openstack import resource
class AddressScope(resource.Resource):
"""Address scope extension."""
resource_key = 'address_scope'
resources_key = 'address_scopes'
base_path = '/address-scopes'
@ -29,7 +30,8 @@ class AddressScope(resource.Resource):
allow_list = True
_query_mapping = resource.QueryParameters(
'name', 'ip_version',
'name',
'ip_version',
'project_id',
is_shared='shared',
)

View File

@ -17,6 +17,7 @@ from openstack import utils
class Agent(resource.Resource):
"""Neutron agent extension."""
resource_key = 'agent'
resources_key = 'agents'
base_path = '/agents'
@ -32,9 +33,14 @@ class Agent(resource.Resource):
# NOTE: We skip query for JSON fields and datetime fields
_query_mapping = resource.QueryParameters(
'agent_type', 'availability_zone', 'binary', 'description', 'host',
'agent_type',
'availability_zone',
'binary',
'description',
'host',
'topic',
is_admin_state_up='admin_state_up', is_alive='alive',
is_admin_state_up='admin_state_up',
is_alive='alive',
)
# Properties
@ -85,8 +91,9 @@ class Agent(resource.Resource):
def remove_agent_from_network(self, session, network_id):
body = {'network_id': network_id}
url = utils.urljoin(self.base_path, self.id, 'dhcp-networks',
network_id)
url = utils.urljoin(
self.base_path, self.id, 'dhcp-networks', network_id
)
session.delete(url, json=body)
def add_router_to_agent(self, session, router):

View File

@ -30,7 +30,9 @@ class AvailabilityZone(_resource.Resource):
# NOTE: We don't support query by state yet because there is a mapping
# at neutron side difficult to map.
_query_mapping = _resource.QueryParameters(
name='availability_zone', resource='agent_type')
name='availability_zone',
resource='agent_type',
)
# Properties
#: Name of the availability zone.

View File

@ -43,7 +43,8 @@ class BgpSpeaker(resource.Resource):
#: Whether to enable or disable the advertisement of floating ip host
#: routes by the BGP Speaker. True by default.
advertise_floating_ip_host_routes = resource.Body(
'advertise_floating_ip_host_routes')
'advertise_floating_ip_host_routes'
)
#: Whether to enable or disable the advertisement of tenant network
#: routes by the BGP Speaker. True by default.
advertise_tenant_networks = resource.Body('advertise_tenant_networks')
@ -164,6 +165,5 @@ class BgpSpeaker(resource.Resource):
:param bgp_agent_id: The id of the dynamic routing agent from which
remove the speaker.
"""
url = utils.urljoin('agents', bgp_agent_id,
'bgp-drinstances', self.id)
url = utils.urljoin('agents', bgp_agent_id, 'bgp-drinstances', self.id)
session.delete(url)

View File

@ -31,9 +31,15 @@ class FirewallGroup(resource.Resource):
allow_list = True
_query_mapping = resource.QueryParameters(
'description', 'egress_firewall_policy_id',
'ingress_firewall_policy_id', 'name', 'shared', 'status', 'ports',
'project_id')
'description',
'egress_firewall_policy_id',
'ingress_firewall_policy_id',
'name',
'shared',
'status',
'ports',
'project_id',
)
# Properties
#: The administrative state of the firewall group, which is up (true) or

View File

@ -33,7 +33,12 @@ class FirewallPolicy(resource.Resource):
allow_list = True
_query_mapping = resource.QueryParameters(
'description', 'firewall_rules', 'name', 'project_id', 'shared')
'description',
'firewall_rules',
'name',
'project_id',
'shared',
)
# Properties
#: Each time that the firewall policy or its associated rules are changed,

View File

@ -31,9 +31,20 @@ class FirewallRule(resource.Resource):
allow_list = True
_query_mapping = resource.QueryParameters(
'action', 'description', 'destination_ip_address', 'name',
'destination_port', 'enabled', 'ip_version', 'project_id', 'protocol',
'shared', 'source_ip_address', 'source_port', 'firewall_policy_id')
'action',
'description',
'destination_ip_address',
'name',
'destination_port',
'enabled',
'ip_version',
'project_id',
'protocol',
'shared',
'source_ip_address',
'source_port',
'firewall_policy_id',
)
# Properties
#: The action that the API performs on traffic that matches the firewall

View File

@ -29,7 +29,11 @@ class Flavor(resource.Resource):
allow_list = True
_query_mapping = resource.QueryParameters(
'description', 'name', 'service_type', is_enabled='enabled')
'description',
'name',
'service_type',
is_enabled='enabled',
)
# properties
#: description for the flavor
@ -44,7 +48,8 @@ class Flavor(resource.Resource):
service_profile_ids = resource.Body('service_profiles', type=list)
def associate_flavor_with_service_profile(
self, session, service_profile_id=None):
self, session, service_profile_id=None
):
flavor_id = self.id
url = utils.urljoin(self.base_path, flavor_id, 'service_profiles')
body = {"service_profile": {"id": service_profile_id}}
@ -52,9 +57,13 @@ class Flavor(resource.Resource):
return resp.json()
def disassociate_flavor_from_service_profile(
self, session, service_profile_id=None):
self, session, service_profile_id=None
):
flavor_id = self.id
url = utils.urljoin(
self.base_path, flavor_id, 'service_profiles', service_profile_id)
session.delete(url,)
self.base_path, flavor_id, 'service_profiles', service_profile_id
)
session.delete(
url,
)
return None

View File

@ -30,12 +30,19 @@ class FloatingIP(_base.NetworkResource, tag.TagMixin):
# For backward compatibility include tenant_id as query param
_query_mapping = resource.QueryParameters(
'description', 'fixed_ip_address',
'floating_ip_address', 'floating_network_id',
'port_id', 'router_id', 'status', 'subnet_id',
'project_id', 'tenant_id',
'description',
'fixed_ip_address',
'floating_ip_address',
'floating_network_id',
'port_id',
'router_id',
'status',
'subnet_id',
'project_id',
'tenant_id',
tenant_id='project_id',
**tag.TagMixin._tag_query_parameters)
**tag.TagMixin._tag_query_parameters
)
# Properties
#: Timestamp at which the floating IP was created.

View File

@ -28,8 +28,14 @@ class HealthMonitor(resource.Resource):
allow_list = True
_query_mapping = resource.QueryParameters(
'delay', 'expected_codes', 'http_method', 'max_retries',
'timeout', 'type', 'url_path', 'project_id',
'delay',
'expected_codes',
'http_method',
'max_retries',
'timeout',
'type',
'url_path',
'project_id',
is_admin_state_up='adminstate_up',
)

View File

@ -28,9 +28,15 @@ class Listener(resource.Resource):
allow_list = True
_query_mapping = resource.QueryParameters(
'connection_limit', 'default_pool_id', 'default_tls_container_ref',
'description', 'name', 'project_id', 'protocol', 'protocol_port',
is_admin_state_up='admin_state_up'
'connection_limit',
'default_pool_id',
'default_tls_container_ref',
'description',
'name',
'project_id',
'protocol',
'protocol_port',
is_admin_state_up='admin_state_up',
)
# Properties

View File

@ -28,9 +28,15 @@ class LoadBalancer(resource.Resource):
allow_list = True
_query_mapping = resource.QueryParameters(
'description', 'name', 'project_id', 'provider', 'provisioning_status',
'tenant_id', 'vip_address', 'vip_subnet_id',
is_admin_state_up='admin_state_up'
'description',
'name',
'project_id',
'provider',
'provisioning_status',
'tenant_id',
'vip_address',
'vip_subnet_id',
is_admin_state_up='admin_state_up',
)
# Properties

View File

@ -18,6 +18,7 @@ from openstack import resource
class LocalIP(resource.Resource):
"""Local IP extension."""
resource_name = "local ip"
resource_key = "local_ip"
resources_key = "local_ips"
@ -33,10 +34,14 @@ class LocalIP(resource.Resource):
_allow_unknown_attrs_in_body = True
_query_mapping = resource.QueryParameters(
"sort_key", "sort_dir",
'name', 'description',
'project_id', 'network_id',
'local_port_id', 'local_ip_address',
"sort_key",
"sort_dir",
'name',
'description',
'project_id',
'network_id',
'local_port_id',
'local_ip_address',
'ip_mode',
)

View File

@ -18,6 +18,7 @@ from openstack import resource
class LocalIPAssociation(resource.Resource):
"""Local IP extension."""
resource_key = "port_association"
resources_key = "port_associations"
base_path = "/local_ips/%(local_ip_id)s/port_associations"
@ -32,8 +33,11 @@ class LocalIPAssociation(resource.Resource):
_allow_unknown_attrs_in_body = True
_query_mapping = resource.QueryParameters(
'fixed_port_id', 'fixed_ip', 'host',
'fixed_port_id',
'fixed_ip',
'host',
)
# Properties
#: The fixed port ID.
fixed_port_id = resource.Body('fixed_port_id')

View File

@ -28,7 +28,9 @@ class MeteringLabel(resource.Resource):
allow_list = True
_query_mapping = resource.QueryParameters(
'description', 'name', 'project_id',
'description',
'name',
'project_id',
is_shared='shared',
)

View File

@ -28,8 +28,12 @@ class MeteringLabelRule(resource.Resource):
allow_list = True
_query_mapping = resource.QueryParameters(
'direction', 'metering_label_id', 'remote_ip_prefix',
'source_ip_prefix', 'destination_ip_prefix', 'project_id',
'direction',
'metering_label_id',
'remote_ip_prefix',
'source_ip_prefix',
'destination_ip_prefix',
'project_id',
)
# Properties
@ -49,13 +53,15 @@ class MeteringLabelRule(resource.Resource):
tenant_id = resource.Body('tenant_id', deprecated=True)
#: The remote IP prefix to be associated with this metering label rule.
remote_ip_prefix = resource.Body(
'remote_ip_prefix', deprecated=True,
'remote_ip_prefix',
deprecated=True,
deprecation_reason="The use of 'remote_ip_prefix' in metering label "
"rules is deprecated and will be removed in future "
"releases. One should use instead, the "
"'source_ip_prefix' and/or 'destination_ip_prefix' "
"parameters. For more details, you can check the "
"spec: https://review.opendev.org/#/c/744702/.")
"rules is deprecated and will be removed in future "
"releases. One should use instead, the "
"'source_ip_prefix' and/or 'destination_ip_prefix' "
"parameters. For more details, you can check the "
"spec: https://review.opendev.org/#/c/744702/.",
)
#: The source IP prefix to be associated with this metering label rule.
source_ip_prefix = resource.Body('source_ip_prefix')

View File

@ -29,9 +29,15 @@ class NDPProxy(resource.Resource):
_allow_unknown_attrs_in_body = True
_query_mapping = resource.QueryParameters(
"sort_key", "sort_dir",
'name', 'description', 'project_id',
'router_id', 'port_id', 'ip_address')
"sort_key",
"sort_dir",
'name',
'description',
'project_id',
'router_id',
'port_id',
'ip_address',
)
# Properties
#: Timestamp at which the NDP proxy was created.

View File

@ -28,7 +28,9 @@ class Network(_base.NetworkResource, tag.TagMixin):
# NOTE: We don't support query on list or datetime fields yet
_query_mapping = resource.QueryParameters(
'description', 'name', 'status',
'description',
'name',
'status',
'project_id',
ipv4_address_scope_id='ipv4_address_scope',
ipv6_address_scope_id='ipv6_address_scope',
@ -68,13 +70,14 @@ class Network(_base.NetworkResource, tag.TagMixin):
#: The port security status, which is enabled ``True`` or disabled
#: ``False``. *Type: bool* *Default: False*
#: Available for multiple provider extensions.
is_port_security_enabled = resource.Body('port_security_enabled',
type=bool,
default=False)
is_port_security_enabled = resource.Body(
'port_security_enabled', type=bool, default=False
)
#: Whether or not the router is external.
#: *Type: bool* *Default: False*
is_router_external = resource.Body('router:external', type=bool,
default=False)
is_router_external = resource.Body(
'router:external', type=bool, default=False
)
#: Indicates whether this network is shared across all tenants.
#: By default, only administrative users can change this value.
#: *Type: bool*

View File

@ -29,8 +29,10 @@ class NetworkIPAvailability(resource.Resource):
allow_list = True
_query_mapping = resource.QueryParameters(
'ip_version', 'network_id', 'network_name',
'project_id'
'ip_version',
'network_id',
'network_name',
'project_id',
)
# Properties

View File

@ -31,9 +31,16 @@ class NetworkSegmentRange(resource.Resource):
allow_list = True
_query_mapping = resource.QueryParameters(
'name', 'default', 'shared', 'project_id',
'network_type', 'physical_network', 'minimum', 'maximum',
'used', 'available'
'name',
'default',
'shared',
'project_id',
'network_type',
'physical_network',
'minimum',
'maximum',
'used',
'available',
)
# Properties

View File

@ -28,8 +28,14 @@ class Pool(resource.Resource):
allow_list = True
_query_mapping = resource.QueryParameters(
'description', 'lb_algorithm', 'name',
'protocol', 'provider', 'subnet_id', 'virtual_ip_id', 'listener_id',
'description',
'lb_algorithm',
'name',
'protocol',
'provider',
'subnet_id',
'virtual_ip_id',
'listener_id',
'project_id',
is_admin_state_up='admin_state_up',
load_balancer_id='loadbalancer_id',

View File

@ -28,7 +28,11 @@ class PoolMember(resource.Resource):
allow_list = True
_query_mapping = resource.QueryParameters(
'address', 'name', 'protocol_port', 'subnet_id', 'weight',
'address',
'name',
'protocol_port',
'subnet_id',
'weight',
'project_id',
is_admin_state_up='admin_state_up',
)

View File

@ -30,11 +30,25 @@ class Port(_base.NetworkResource, tag.TagMixin):
# NOTE: we skip query on list or datetime fields for now
_query_mapping = resource.QueryParameters(
'binding:host_id', 'binding:profile', 'binding:vif_details',
'binding:vif_type', 'binding:vnic_type',
'description', 'device_id', 'device_owner', 'fields', 'fixed_ips',
'id', 'ip_address', 'mac_address', 'name', 'network_id', 'status',
'subnet_id', 'project_id', 'security_groups',
'binding:host_id',
'binding:profile',
'binding:vif_details',
'binding:vif_type',
'binding:vnic_type',
'description',
'device_id',
'device_owner',
'fields',
'fixed_ips',
'id',
'ip_address',
'mac_address',
'name',
'network_id',
'status',
'subnet_id',
'project_id',
'security_groups',
is_admin_state_up='admin_state_up',
is_port_security_enabled='port_security_enabled',
security_group_ids='security_groups',
@ -44,8 +58,9 @@ class Port(_base.NetworkResource, tag.TagMixin):
# Properties
#: Allowed address pairs list. Dictionary key ``ip_address`` is required
#: and key ``mac_address`` is optional.
allowed_address_pairs: List[dict] = resource.Body('allowed_address_pairs',
type=list)
allowed_address_pairs: List[dict] = resource.Body(
'allowed_address_pairs', type=list
)
#: The ID of the host where the port is allocated. In some cases,
#: different implementations can run on different hosts.
binding_host_id = resource.Body('binding:host_id')
@ -104,8 +119,9 @@ class Port(_base.NetworkResource, tag.TagMixin):
is_admin_state_up = resource.Body('admin_state_up', type=bool)
#: The port security status, which is enabled ``True`` or disabled
#: ``False``. *Type: bool* *Default: False*
is_port_security_enabled = resource.Body('port_security_enabled',
type=bool, default=False)
is_port_security_enabled = resource.Body(
'port_security_enabled', type=bool, default=False
)
#: The MAC address of an allowed address pair.
mac_address = resource.Body('mac_address')
#: The port name.
@ -120,8 +136,9 @@ class Port(_base.NetworkResource, tag.TagMixin):
#: Tenant_id (deprecated attribute).
tenant_id = resource.Body('tenant_id', deprecated=True)
#: Whether to propagate uplink status of the port. *Type: bool*
propagate_uplink_status = resource.Body('propagate_uplink_status',
type=bool)
propagate_uplink_status = resource.Body(
'propagate_uplink_status', type=bool
)
#: Read-only. The ID of the QoS policy attached to the network where the
# port is bound.
qos_network_policy_id = resource.Body('qos_network_policy_id')

View File

@ -30,7 +30,9 @@ class PortForwarding(resource.Resource):
allow_list = True
_query_mapping = resource.QueryParameters(
'internal_port_id', 'external_port', 'protocol'
'internal_port_id',
'external_port',
'protocol',
)
# Properties

View File

@ -29,7 +29,9 @@ class QoSPolicy(resource.Resource, tag.TagMixin):
allow_list = True
_query_mapping = resource.QueryParameters(
'name', 'description', 'is_default',
'name',
'description',
'is_default',
'project_id',
is_shared='shared',
**tag.TagMixin._tag_query_parameters

View File

@ -28,7 +28,11 @@ class QoSRuleType(resource.Resource):
allow_list = True
_query_mapping = resource.QueryParameters(
'type', 'drivers', 'all_rules', 'all_supported')
'type',
'drivers',
'all_rules',
'all_supported',
)
# Properties
#: QoS rule type name.

View File

@ -60,10 +60,12 @@ class Quota(resource.Resource):
#: The maximum amount of security groups you can create. *Type: int*
security_groups = resource.Body('security_group', type=int)
def _prepare_request(self, requires_id=True, prepend_key=False,
base_path=None, **kwargs):
_request = super(Quota, self)._prepare_request(requires_id,
prepend_key)
def _prepare_request(
self, requires_id=True, prepend_key=False, base_path=None, **kwargs
):
_request = super(Quota, self)._prepare_request(
requires_id, prepend_key
)
if self.resource_key in _request.body:
_body = _request.body[self.resource_key]
else:

View File

@ -28,8 +28,12 @@ class RBACPolicy(resource.Resource):
allow_list = True
_query_mapping = resource.QueryParameters(
'action', 'object_id', 'object_type', 'project_id',
'target_project_id', target_project_id='target_tenant',
'action',
'object_id',
'object_type',
'project_id',
'target_project_id',
target_project_id='target_tenant',
)
# Properties

View File

@ -30,7 +30,11 @@ class Router(_base.NetworkResource, tag.TagMixin):
# NOTE: We don't support query on datetime, list or dict fields
_query_mapping = resource.QueryParameters(
'description', 'flavor_id', 'name', 'status', 'project_id',
'description',
'flavor_id',
'name',
'status',
'project_id',
is_admin_state_up='admin_state_up',
is_distributed='distributed',
is_ha='ha',
@ -40,8 +44,9 @@ class Router(_base.NetworkResource, tag.TagMixin):
# Properties
#: Availability zone hints to use when scheduling the router.
#: *Type: list of availability zone names*
availability_zone_hints = resource.Body('availability_zone_hints',
type=list)
availability_zone_hints = resource.Body(
'availability_zone_hints', type=list
)
#: Availability zones for the router.
#: *Type: list of availability zone names*
availability_zones = resource.Body('availability_zones', type=list)
@ -155,8 +160,7 @@ class Router(_base.NetworkResource, tag.TagMixin):
:returns: The body of the response as a dictionary.
"""
url = utils.urljoin(self.base_path, self.id,
'add_gateway_router')
url = utils.urljoin(self.base_path, self.id, 'add_gateway_router')
resp = session.put(url, json=body)
return resp.json()
@ -169,8 +173,7 @@ class Router(_base.NetworkResource, tag.TagMixin):
:returns: The body of the response as a dictionary.
"""
url = utils.urljoin(self.base_path, self.id,
'remove_gateway_router')
url = utils.urljoin(self.base_path, self.id, 'remove_gateway_router')
resp = session.put(url, json=body)
return resp.json()
@ -188,4 +191,5 @@ class L3AgentRouter(Router):
allow_delete = False
allow_list = True
# NOTE: No query parameter is supported

View File

@ -27,8 +27,16 @@ class SecurityGroup(_base.NetworkResource, tag.TagMixin):
allow_list = True
_query_mapping = resource.QueryParameters(
'description', 'fields', 'id', 'name', 'stateful', 'project_id',
'tenant_id', 'revision_number', 'sort_dir', 'sort_key',
'description',
'fields',
'id',
'name',
'stateful',
'project_id',
'tenant_id',
'revision_number',
'sort_dir',
'sort_key',
**tag.TagMixin._tag_query_parameters
)

View File

@ -27,13 +27,21 @@ class SecurityGroupRule(_base.NetworkResource, tag.TagMixin):
allow_list = True
_query_mapping = resource.QueryParameters(
'description', 'direction', 'id', 'protocol',
'remote_group_id', 'security_group_id',
'description',
'direction',
'id',
'protocol',
'remote_group_id',
'security_group_id',
'remote_address_group_id',
'port_range_max', 'port_range_min',
'remote_ip_prefix', 'revision_number',
'project_id', 'tenant_id',
'sort_dir', 'sort_key',
'port_range_max',
'port_range_min',
'remote_ip_prefix',
'revision_number',
'project_id',
'tenant_id',
'sort_dir',
'sort_key',
ether_type='ethertype',
**tag.TagMixin._tag_query_parameters
)
@ -89,7 +97,8 @@ class SecurityGroupRule(_base.NetworkResource, tag.TagMixin):
def _prepare_request(self, *args, **kwargs):
_request = super(SecurityGroupRule, self)._prepare_request(
*args, **kwargs)
*args, **kwargs
)
# Old versions of Neutron do not handle being passed a
# remote_address_group_id and raise and error. Remove it from
# the body if it is blank.

View File

@ -28,8 +28,12 @@ class Segment(resource.Resource):
allow_list = True
_query_mapping = resource.QueryParameters(
'description', 'name', 'network_id', 'network_type',
'physical_network', 'segmentation_id',
'description',
'name',
'network_id',
'network_type',
'physical_network',
'segmentation_id',
)
# Properties

View File

@ -28,7 +28,9 @@ class ServiceProfile(resource.Resource):
allow_list = True
_query_mapping = resource.QueryParameters(
'description', 'driver', 'project_id',
'description',
'driver',
'project_id',
is_enabled='enabled',
)
# Properties

View File

@ -27,8 +27,9 @@ class ServiceProvider(resource.Resource):
allow_list = True
_query_mapping = resource.QueryParameters(
'service_type', 'name',
is_default='default'
'service_type',
'name',
is_default='default',
)
# Properties

View File

@ -28,9 +28,17 @@ class Subnet(_base.NetworkResource, tag.TagMixin):
# NOTE: Query on list or datetime fields are currently not supported.
_query_mapping = resource.QueryParameters(
'cidr', 'description', 'gateway_ip', 'ip_version',
'ipv6_address_mode', 'ipv6_ra_mode', 'name', 'network_id',
'segment_id', 'dns_publish_fixed_ip', 'project_id',
'cidr',
'description',
'gateway_ip',
'ip_version',
'ipv6_address_mode',
'ipv6_ra_mode',
'name',
'network_id',
'segment_id',
'dns_publish_fixed_ip',
'project_id',
is_dhcp_enabled='enable_dhcp',
subnet_pool_id='subnetpool_id',
use_default_subnet_pool='use_default_subnetpool',
@ -87,6 +95,5 @@ class Subnet(_base.NetworkResource, tag.TagMixin):
updated_at = resource.Body('updated_at')
#: Whether to use the default subnet pool to obtain a CIDR.
use_default_subnet_pool = resource.Body(
'use_default_subnetpool',
type=bool
'use_default_subnetpool', type=bool
)

View File

@ -28,8 +28,12 @@ class SubnetPool(resource.Resource, tag.TagMixin):
allow_list = True
_query_mapping = resource.QueryParameters(
'address_scope_id', 'description', 'ip_version', 'is_default',
'name', 'project_id',
'address_scope_id',
'description',
'ip_version',
'is_default',
'name',
'project_id',
is_shared='shared',
**tag.TagMixin._tag_query_parameters
)

View File

@ -30,8 +30,10 @@ class TapFlow(resource.Resource):
_allow_unknown_attrs_in_body = True
_query_mapping = resource.QueryParameters(
"sort_key", "sort_dir",
'name', 'project_id'
"sort_key",
"sort_dir",
'name',
'project_id',
)
# Properties

View File

@ -30,8 +30,7 @@ class TapService(resource.Resource):
_allow_unknown_attrs_in_body = True
_query_mapping = resource.QueryParameters(
"sort_key", "sort_dir",
'name', 'project_id'
"sort_key", "sort_dir", 'name', 'project_id'
)
# Properties

View File

@ -30,7 +30,11 @@ class Trunk(resource.Resource, tag.TagMixin):
allow_list = True
_query_mapping = resource.QueryParameters(
'name', 'description', 'port_id', 'status', 'sub_ports',
'name',
'description',
'port_id',
'status',
'sub_ports',
'project_id',
is_admin_state_up='admin_state_up',
**tag.TagMixin._tag_query_parameters

View File

@ -28,8 +28,11 @@ class VpnEndpointGroup(resource.Resource):
allow_list = True
_query_mapping = resource.QueryParameters(
'description', 'name', 'project_id', 'tenant_id',
type='endpoint_type'
'description',
'name',
'project_id',
'tenant_id',
type='endpoint_type',
)
# Properties

View File

@ -15,6 +15,7 @@ from openstack import resource
class VpnIkePolicy(resource.Resource):
"""VPN IKE policy extension."""
resource_key = 'ikepolicy'
resources_key = 'ikepolicies'
base_path = '/vpn/ikepolicies'
@ -27,8 +28,14 @@ class VpnIkePolicy(resource.Resource):
allow_list = True
_query_mapping = resource.QueryParameters(
'auth_algorithm', 'description', 'encryption_algorithm', 'ike_version',
'name', 'pfs', 'project_id', 'phase1_negotiation_mode',
'auth_algorithm',
'description',
'encryption_algorithm',
'ike_version',
'name',
'pfs',
'project_id',
'phase1_negotiation_mode',
)
# Properties

View File

@ -26,8 +26,13 @@ class VpnIpsecPolicy(resource.Resource):
allow_list = True
_query_mapping = resource.QueryParameters(
'auth_algorithm', 'description', 'encryption_algorithm', 'name', 'pfs',
'project_id', 'phase1_negotiation_mode',
'auth_algorithm',
'description',
'encryption_algorithm',
'name',
'pfs',
'project_id',
'phase1_negotiation_mode',
)
# Properties

View File

@ -26,11 +26,24 @@ class VpnIPSecSiteConnection(resource.Resource):
allow_list = True
_query_mapping = resource.QueryParameters(
'auth_mode', 'description', 'ikepolicy_id', 'ipsecpolicy_id',
'initiator', 'local_ep_group_id', 'peer_address', 'local_id',
'mtu', 'name', 'peer_id', 'project_id', 'psk', 'peer_ep_group_id',
'route_mode', 'vpnservice_id', 'status',
is_admin_state_up='admin_state_up'
'auth_mode',
'description',
'ikepolicy_id',
'ipsecpolicy_id',
'initiator',
'local_ep_group_id',
'peer_address',
'local_id',
'mtu',
'name',
'peer_id',
'project_id',
'psk',
'peer_ep_group_id',
'route_mode',
'vpnservice_id',
'status',
is_admin_state_up='admin_state_up',
)
# Properties

View File

@ -28,9 +28,15 @@ class VpnService(resource.Resource):
allow_list = True
_query_mapping = resource.QueryParameters(
'description', 'external_v4_ip', 'external_v6_ip', 'name', 'router_id',
'project_id', 'tenant_id', 'subnet_id',
is_admin_state_up='admin_state_up'
'description',
'external_v4_ip',
'external_v6_ip',
'name',
'router_id',
'project_id',
'tenant_id',
'subnet_id',
is_admin_state_up='admin_state_up',
)
# Properties

View File

@ -46,13 +46,15 @@ class TestAddressGroup(base.BaseFunctionalTest):
def tearDown(self):
sot = self.user_cloud.network.delete_address_group(
self.ADDRESS_GROUP_ID)
self.ADDRESS_GROUP_ID
)
self.assertIsNone(sot)
super(TestAddressGroup, self).tearDown()
def test_find(self):
sot = self.user_cloud.network.find_address_group(
self.ADDRESS_GROUP_NAME)
self.ADDRESS_GROUP_NAME
)
self.assertEqual(self.ADDRESS_GROUP_ID, sot.id)
def test_get(self):