diff -Nru python-neutron-lib-1.22.0/api-ref/source/v2/agents.inc python-neutron-lib-1.25.0/api-ref/source/v2/agents.inc --- python-neutron-lib-1.22.0/api-ref/source/v2/agents.inc 2019-01-21 20:24:20.000000000 +0000 +++ python-neutron-lib-1.25.0/api-ref/source/v2/agents.inc 2019-02-28 17:08:45.000000000 +0000 @@ -6,6 +6,12 @@ Lists, shows details for, updates, and deletes agents. +Agent Resources Synced Extension +================================ + +The ``agent-resources-synced`` extension adds the ``resources_synced`` attribute +to agents. + Availability Zone Extension =========================== @@ -63,6 +69,7 @@ - heartbeat_timestamp: heartbeat_timestamp - host: host - id: id + - resources_synced: agent_resources_synced - started_at: started_at - topic: topic @@ -109,6 +116,7 @@ - heartbeat_timestamp: heartbeat_timestamp - host: host - id: id + - resources_synced: agent_resources_synced - started_at: started_at - topic: topic @@ -162,6 +170,7 @@ - heartbeat_timestamp: heartbeat_timestamp - host: host - id: id + - resources_synced: agent_resources_synced - started_at: started_at - topic: topic diff -Nru python-neutron-lib-1.22.0/api-ref/source/v2/index.rst python-neutron-lib-1.25.0/api-ref/source/v2/index.rst --- python-neutron-lib-1.22.0/api-ref/source/v2/index.rst 2019-01-21 20:24:20.000000000 +0000 +++ python-neutron-lib-1.25.0/api-ref/source/v2/index.rst 2019-02-28 17:08:45.000000000 +0000 @@ -31,6 +31,7 @@ .. include:: fip-port-forwarding.inc .. include:: routers.inc .. include:: subnetpools.inc +.. include:: subnetpool_prefix_ops.inc .. include:: subnets.inc ######## Security @@ -84,6 +85,10 @@ Logging ####### .. include:: logging.inc +############################### +Neutron-Neutron Interconnection +############################### +.. include:: interconnection.inc ################# Networking Agents ################# diff -Nru python-neutron-lib-1.22.0/api-ref/source/v2/interconnection.inc python-neutron-lib-1.25.0/api-ref/source/v2/interconnection.inc --- python-neutron-lib-1.22.0/api-ref/source/v2/interconnection.inc 1970-01-01 00:00:00.000000000 +0000 +++ python-neutron-lib-1.25.0/api-ref/source/v2/interconnection.inc 2019-02-28 17:08:45.000000000 +0000 @@ -0,0 +1,237 @@ +.. -*- rst -*- + +=============================== +Neutron-Neutron Interconnection +=============================== + +Introduces a new ``interconnection`` resource. + +When an interconnection is created by a tenant, parameters specific to the +interconnection mechanism (``local_parameters`` and ``remote_parameters``) are +only visible by the admin or users with specific role (default role: +``neutron_interconnection_peer``). + +Creates, modifies, and deletes Neutron-Neutron interconnections. + +List interconnections +===================== + +.. rest_method:: GET /v2.0/interconnection/interconnections + +Lists all interconnections belonging to the project. + +Use the ``fields`` query parameter to control which fields are +returned in the response body. Additionally, you can filter results +by using query string parameters. For information, see `Filtering +and Column Selection `__. + +Normal response codes: 200 + +Error response codes: 400, 401, 403 + +Request +------- + +.. rest_parameters:: parameters.yaml + + - fields: fields + +Response Parameters +------------------- + +.. rest_parameters:: parameters.yaml + + - interconnections: interconnections + - project_id: project_id + - id: interconnection-id-body + - name: interconnection-name-required + - type: interconnection-type-required + - state: interconnection-state + - local_resource_id: interconnection-local_resource_id + - remote_resource_id: interconnection-remote_resource_id + - remote_keystone: interconnection-remote_keystone + - remote_region: interconnection-remote_region + - remote_interconnection_id: interconnection-remote_interconnection_id + - local_parameters: interconnection-local_parameters + - remote_parameters: interconnection-remote_parameters + +Response Example +---------------- + +.. literalinclude:: samples/interconnection/interconnections-list-response.json + :language: javascript + +Create interconnection +====================== + +.. rest_method:: POST /v2.0/interconnection/interconnections + +Creates an interconnection. + +Normal response codes: 201 + +Error response codes: 400, 401, 403 + +Request +------- + +.. rest_parameters:: parameters.yaml + + - interconnection: interconnection + - project_id: project_id-request + - name: interconnection-name + - type: interconnection-type + - local_resource_id: interconnection-local_resource_id + - remote_resource_id: interconnection-remote_resource_id + - remote_keystone: interconnection-remote_keystone + - remote_region: interconnection-remote_region + +Request Example +--------------- + +.. literalinclude:: samples/interconnection/interconnection-create-request.json + :language: javascript + +Response Parameters +------------------- + +.. rest_parameters:: parameters.yaml + + - interconnection: interconnection + - project_id: project_id + - id: interconnection-id-body + - name: interconnection-name-required + - type: interconnection-type-required + - state: interconnection-state + - local_resource_id: interconnection-local_resource_id + - remote_resource_id: interconnection-remote_resource_id + - remote_keystone: interconnection-remote_keystone + - remote_region: interconnection-remote_region + - remote_interconnection_id: interconnection-remote_interconnection_id + - local_parameters: interconnection-local_parameters + - remote_parameters: interconnection-remote_parameters + +Response Example +---------------- + +.. literalinclude:: samples/interconnection/interconnection-create-response.json + :language: javascript + +Show interconnection details +============================ + +.. rest_method:: GET /v2.0/interconnection/interconnections/{interconnection_id} + +Shows an interconnection details. + +Normal response codes: 200 + +Error response codes: 401, 403, 404 + +Request +------- + +.. rest_parameters:: parameters.yaml + + - interconnection_id: interconnection-id-path + +Response Parameters +------------------- + +.. rest_parameters:: parameters.yaml + + - interconnection: interconnection + - project_id: project_id + - id: interconnection-id-body + - name: interconnection-name-required + - type: interconnection-type-required + - state: interconnection-state + - local_resource_id: interconnection-local_resource_id + - remote_resource_id: interconnection-remote_resource_id + - remote_keystone: interconnection-remote_keystone + - remote_region: interconnection-remote_region + - remote_interconnection_id: interconnection-remote_interconnection_id + - local_parameters: interconnection-local_parameters + - remote_parameters: interconnection-remote_parameters + +Response Example +---------------- + +.. literalinclude:: samples/interconnection/interconnection-show-response.json + :language: javascript + +Update an interconnection +========================= + +.. rest_method:: PUT /v2.0/interconnection/interconnections/{interconnection_id} + +Updates an interconnection. + +Normal response codes: 201 + +Error response codes: 400, 401, 403, 404 + +Request +------- +A user can only update the name parameter. + +.. rest_parameters:: parameters.yaml + + - interconnection_id: interconnection-id-path + - interconnection: interconnection + - name: interconnection-name + +Request Example +--------------- + +.. literalinclude:: samples/interconnection/interconnection-update-request.json + :language: javascript + +Response Parameters +------------------- + +.. rest_parameters:: parameters.yaml + + - interconnection: interconnection + - project_id: project_id + - id: interconnection-id-body + - name: interconnection-name-required + - type: interconnection-type-required + - state: interconnection-state + - local_resource_id: interconnection-local_resource_id + - remote_resource_id: interconnection-remote_resource_id + - remote_keystone: interconnection-remote_keystone + - remote_region: interconnection-remote_region + - remote_interconnection_id: interconnection-remote_interconnection_id + - local_parameters: interconnection-local_parameters + - remote_parameters: interconnection-remote_parameters + +Response Example +---------------- + +.. literalinclude:: samples/interconnection/interconnection-update-response.json + :language: javascript + +Delete interconnection +====================== + +.. rest_method:: DELETE /v2.0/interconnection/interconnections/{interconnection_id} + +Deletes an interconnection. + +Normal response codes: 204 + +Error response codes: 401, 403, 404 + +Request +------- + +.. rest_parameters:: parameters.yaml + + - interconnection_id: interconnection-id-path + +Response +-------- + +There is no body content for the response of a successful DELETE request. diff -Nru python-neutron-lib-1.22.0/api-ref/source/v2/networks.inc python-neutron-lib-1.25.0/api-ref/source/v2/networks.inc --- python-neutron-lib-1.22.0/api-ref/source/v2/networks.inc 2019-01-21 20:24:20.000000000 +0000 +++ python-neutron-lib-1.25.0/api-ref/source/v2/networks.inc 2019-02-28 17:08:45.000000000 +0000 @@ -40,6 +40,13 @@ networks. This boolean attribute indicates the network has an external routing facility that's not managed by the networking service. +FloatingIP autodelete internal +============================== + +The ``floatingip-autodelete-internal`` shim extension signals that the +update of a network's ``router:external`` attribute from ``true`` to +``false`` autodeletes the unused Floating IPs of that network. + L2 adjacency extension ====================== diff -Nru python-neutron-lib-1.22.0/api-ref/source/v2/parameters.yaml python-neutron-lib-1.25.0/api-ref/source/v2/parameters.yaml --- python-neutron-lib-1.22.0/api-ref/source/v2/parameters.yaml 2019-01-21 20:24:20.000000000 +0000 +++ python-neutron-lib-1.25.0/api-ref/source/v2/parameters.yaml 2019-02-28 17:08:45.000000000 +0000 @@ -133,6 +133,12 @@ in: path required: true type: string +interconnection-id-path: + description: | + The ID of the interconnection. + in: path + required: true + type: string ipsecpolicy_id-path: description: | The ID of the IPsec policy. @@ -877,15 +883,17 @@ object_id-query: description: | Filter the RBAC policy list result by the ID of the ``object_type`` - resource. An ``object_type`` of ``network`` returns a network ID and - an ``object_type`` of ``qos-policy`` returns a QoS policy ID. + resource. An ``object_type`` of ``network`` returns a network ID, + an ``object_type`` of ``qos-policy`` returns a QoS policy ID, and + an ``object_type`` of ``security-group`` returns a security group ID. in: query required: false type: string object_type-query: description: | Filter the RBAC policy list result by the type of the object that the - RBAC policy affects. Types include ``qos-policy`` or ``network``. + RBAC policy affects. Types include ``qos-policy``, ``network``, or + ``security-group``. in: query required: false type: string @@ -1484,6 +1492,19 @@ required: true type: object type: string +agent_resources_synced: + description: | + The value ``null`` means no resource view synchronization to Placement + was attempted. ``true`` / ``false`` values signify the success of + the last synchronization attempt. Therefore the relevant resources + in Placement can only be considered up to date if this attribute is + ``true``. This attribute is read-only, it is only supposed to be + updated internally, but it is readable for debugging purposes. Not all + agent types track resources via Placement, therefore the value ``null`` + does not necessarily means there is an error in the system. + in: body + required: false + type: boolean agent_type: description: | The type of agent such as ``Open vSwitch agent`` or ``DHCP agent``. @@ -3394,6 +3415,104 @@ in: body required: false type: string +interconnection: + description: | + An ``interconnection`` object. + in: body + required: true + type: object +interconnection-id-body: + description: | + The ID of the ``interconnection``. + in: body + required: true + type: string +interconnection-local_parameters: + description: | + Parameters specific to local interconnection mechanism, represented by a + dict with a type (``bgpvpn``, ``vxlan``, etc...) key and corresponding + identifier (BGPVPN RT, VNI, etc...) value. + in: body + required: false + type: dict +interconnection-local_resource_id: + description: | + The ID of the local Neutron resource (network or router) to interconnect + with remote Neutron resource. + in: body + required: true + type: string +interconnection-name: + description: | + Name of the ``interconnection``. + in: body + required: false + type: string +interconnection-name-required: + description: | + Name of the ``interconnection``. + in: body + required: true + type: string +interconnection-remote_interconnection_id: + description: | + ID of the symmetric ``interconnection`` exchanged with remote Neutron. + in: body + required: true + type: string +interconnection-remote_keystone: + description: | + ``auth_url`` of the remote Keystone service. + in: body + required: false + type: string +interconnection-remote_parameters: + description: | + Parameters specific to remote interconnection mechanism exchanged with + remote Neutron, represented by a dict with a type (``bgpvpn``, ``vxlan``, + etc...) key and corresponding identifier (BGPVPN RT, VNI, etc...) value. + in: body + required: false + type: dict +interconnection-remote_region: + description: | + Remote region name. + in: body + required: false + type: string +interconnection-remote_resource_id: + description: | + The ID of the remote Neutron resource (network or router) to interconnect + with local Neutron resource. + in: body + required: true + type: string +interconnection-state: + description: | + Indicates the state of the ``interconnection``. + in: body + required: true + type: string +interconnection-type: + description: | + Selection of the type of interconnection. Allowed values are ``network_l2``, + ``network_l3`` or ``router``. Default is ``network_l3``. + in: body + required: false + type: string +interconnection-type-required: + description: | + Selection of the type of interconnection. Allowed values are ``network_l2``, + ``network_l3`` or ``router``. Default is ``network_l3``. + in: body + required: true + type: string +interconnections: + description: | + A list of ``interconnection`` objects. + in: body + required: true + type: array interfaces: description: | Router interfaces @@ -4554,6 +4673,22 @@ in: body required: true type: array +prefixes-response: + description: | + A list of the subnet prefixes currently assigned to the subnet + pool. Adjacent prefixes are merged and treated as a single prefix. + in: body + required: true + type: array +prefixes_remove: + description: | + A list of subnet prefixes to remove from the subnet pool. + The API splits larger prefixes when a subset prefix is removed, + and merges any resulting adjacent prefixes to treat them as a single + prefix. + in: body + required: true + type: array project_id: description: | The ID of the project. @@ -5424,7 +5559,9 @@ router:external: description: | Indicates whether the network has an external routing facility that's not - managed by the networking service. + managed by the networking service. If the network is updated from external + to internal the unused floating IPs of this network are automatically + deleted when extension ``floatingip-autodelete-internal`` is present. in: body required: true type: boolean diff -Nru python-neutron-lib-1.22.0/api-ref/source/v2/rbac-policy.inc python-neutron-lib-1.25.0/api-ref/source/v2/rbac-policy.inc --- python-neutron-lib-1.22.0/api-ref/source/v2/rbac-policy.inc 2019-01-21 20:24:20.000000000 +0000 +++ python-neutron-lib-1.25.0/api-ref/source/v2/rbac-policy.inc 2019-02-28 17:08:45.000000000 +0000 @@ -6,6 +6,9 @@ Lists, shows details for, creates, updates, and deletes RBAC policies. +The presence of the ``rbac-security-groups`` extension extends this +API to support object types of ``security_group``. + Show RBAC policy details ======================== diff -Nru python-neutron-lib-1.22.0/api-ref/source/v2/samples/agents/agent-show-response.json python-neutron-lib-1.25.0/api-ref/source/v2/samples/agents/agent-show-response.json --- python-neutron-lib-1.22.0/api-ref/source/v2/samples/agents/agent-show-response.json 2019-01-21 20:24:20.000000000 +0000 +++ python-neutron-lib-1.25.0/api-ref/source/v2/samples/agents/agent-show-response.json 2019-02-28 17:08:45.000000000 +0000 @@ -12,6 +12,7 @@ "agent_type": "Open vSwitch agent", "started_at": "2017-09-12 19:35:38", "created_at": "2017-09-12 19:35:38", + "resources_synced": true, "configurations": { "ovs_hybrid_plug": true, "in_distributed_mode": false, diff -Nru python-neutron-lib-1.22.0/api-ref/source/v2/samples/agents/agents-list-response.json python-neutron-lib-1.25.0/api-ref/source/v2/samples/agents/agents-list-response.json --- python-neutron-lib-1.22.0/api-ref/source/v2/samples/agents/agents-list-response.json 2019-01-21 20:24:20.000000000 +0000 +++ python-neutron-lib-1.25.0/api-ref/source/v2/samples/agents/agents-list-response.json 2019-02-28 17:08:45.000000000 +0000 @@ -13,6 +13,7 @@ "agent_type": "Open vSwitch agent", "started_at": "2017-09-12 19:35:38", "created_at": "2017-09-12 19:35:38", + "resources_synced": true, "configurations": { "ovs_hybrid_plug": true, "in_distributed_mode": false, @@ -66,6 +67,7 @@ "agent_type" :"DHCP agent", "started_at": "2017-09-12 19:35:36", "created_at": "2017-09-12 19:35:36", + "resources_synced": null, "configurations": { "subnets": 2, "dhcp_lease_duration": 86400, @@ -88,6 +90,7 @@ "agent_type": "L3 agent", "started_at": "2017-09-12 19:35:38", "created_at": "2017-09-12 19:35:38", + "resources_synced": null, "configurations": { "agent_mode": "legacy", "gateway_external_network_id": "", @@ -114,6 +117,7 @@ "agent_type": "Metadata agent", "started_at": "2017-09-12 19:35:39", "created_at": "2017-09-12 19:35:39", + "resources_synced": null, "configurations": { "log_agent_heartbeats": false, "nova_metadata_host": "172.16.78.191", diff -Nru python-neutron-lib-1.22.0/api-ref/source/v2/samples/agents/agent-update-response.json python-neutron-lib-1.25.0/api-ref/source/v2/samples/agents/agent-update-response.json --- python-neutron-lib-1.22.0/api-ref/source/v2/samples/agents/agent-update-response.json 2019-01-21 20:24:20.000000000 +0000 +++ python-neutron-lib-1.25.0/api-ref/source/v2/samples/agents/agent-update-response.json 2019-02-28 17:08:45.000000000 +0000 @@ -12,6 +12,7 @@ "agent_type": "Open vSwitch agent", "started_at": "2017-09-12 19:35:38", "created_at": "2017-09-12 19:35:38", + "resources_synced": true, "configurations": { "ovs_hybrid_plug": true, "in_distributed_mode": false, diff -Nru python-neutron-lib-1.22.0/api-ref/source/v2/samples/interconnection/interconnection-create-request.json python-neutron-lib-1.25.0/api-ref/source/v2/samples/interconnection/interconnection-create-request.json --- python-neutron-lib-1.22.0/api-ref/source/v2/samples/interconnection/interconnection-create-request.json 1970-01-01 00:00:00.000000000 +0000 +++ python-neutron-lib-1.25.0/api-ref/source/v2/samples/interconnection/interconnection-create-request.json 2019-02-28 17:08:45.000000000 +0000 @@ -0,0 +1,11 @@ +{ + "interconnection": { + "project_id": "5455570dafa34c32abb69c70005a57de", + "name": "interconnection1", + "type": "network_l3", + "local_resource_id": "5d6820bf-a528-4e0c-85df-c2e771368d55", + "remote_resource_id": "a02d408d-7493-4291-b7bc-56894d063693", + "remote_keystone": "http://10.0.0.100/identity", + "remote_region": "RegionOne" + } +} diff -Nru python-neutron-lib-1.22.0/api-ref/source/v2/samples/interconnection/interconnection-create-response.json python-neutron-lib-1.25.0/api-ref/source/v2/samples/interconnection/interconnection-create-response.json --- python-neutron-lib-1.22.0/api-ref/source/v2/samples/interconnection/interconnection-create-response.json 1970-01-01 00:00:00.000000000 +0000 +++ python-neutron-lib-1.25.0/api-ref/source/v2/samples/interconnection/interconnection-create-response.json 2019-02-28 17:08:45.000000000 +0000 @@ -0,0 +1,14 @@ +{ + "interconnection": { + "id": "1bdffef1-fc49-4299-b9b5-005a2861e716", + "project_id": "5455570dafa34c32abb69c70005a57de", + "name": "interconnection1", + "type": "network_l3", + "state": "TO_VALIDATE", + "local_resource_id": "5d6820bf-a528-4e0c-85df-c2e771368d55", + "remote_resource_id": "a02d408d-7493-4291-b7bc-56894d063693", + "remote_keystone": "http://10.0.0.100/identity", + "remote_region": "RegionOne", + "remote_interconnection_id": null + } +} diff -Nru python-neutron-lib-1.22.0/api-ref/source/v2/samples/interconnection/interconnection-show-response.json python-neutron-lib-1.25.0/api-ref/source/v2/samples/interconnection/interconnection-show-response.json --- python-neutron-lib-1.22.0/api-ref/source/v2/samples/interconnection/interconnection-show-response.json 1970-01-01 00:00:00.000000000 +0000 +++ python-neutron-lib-1.25.0/api-ref/source/v2/samples/interconnection/interconnection-show-response.json 2019-02-28 17:08:45.000000000 +0000 @@ -0,0 +1,16 @@ +{ + "interconnection": { + "id": "1bdffef1-fc49-4299-b9b5-005a2861e716", + "project_id": "5455570dafa34c32abb69c70005a57de", + "name": "interconnection1", + "type": "router", + "state": "ACTIVE", + "local_resource_id": "5d6820bf-a528-4e0c-85df-c2e771368d55", + "remote_resource_id": "a02d408d-7493-4291-b7bc-56894d063693", + "remote_keystone": "http://10.0.0.100/identity", + "remote_region": "RegionOne", + "remote_interconnection_id": "5f063750-ad6d-4bbe-8b82-aeb49d48ce2d", + "local_parameters": {"bgpvpn": "64512:10"}, + "remote_parameters": {"bgpvpn": "64512:20"} + } +} diff -Nru python-neutron-lib-1.22.0/api-ref/source/v2/samples/interconnection/interconnections-list-response.json python-neutron-lib-1.25.0/api-ref/source/v2/samples/interconnection/interconnections-list-response.json --- python-neutron-lib-1.22.0/api-ref/source/v2/samples/interconnection/interconnections-list-response.json 1970-01-01 00:00:00.000000000 +0000 +++ python-neutron-lib-1.25.0/api-ref/source/v2/samples/interconnection/interconnections-list-response.json 2019-02-28 17:08:45.000000000 +0000 @@ -0,0 +1,18 @@ +{ + "interconnections": [ + { + "id": "1bdffef1-fc49-4299-b9b5-005a2861e716", + "project_id": "5455570dafa34c32abb69c70005a57de", + "name": "interconnection1", + "type": "router", + "state": "ACTIVE", + "local_resource_id": "5d6820bf-a528-4e0c-85df-c2e771368d55", + "remote_resource_id": "a02d408d-7493-4291-b7bc-56894d063693", + "remote_keystone": "http://10.0.0.100/identity", + "remote_region": "RegionOne", + "remote_interconnection_id": "5f063750-ad6d-4bbe-8b82-aeb49d48ce2d", + "local_parameters": {"bgpvpn": "64512:10"}, + "remote_parameters": {"bgpvpn": "64512:20"} + } + ] +} diff -Nru python-neutron-lib-1.22.0/api-ref/source/v2/samples/interconnection/interconnection-update-request.json python-neutron-lib-1.25.0/api-ref/source/v2/samples/interconnection/interconnection-update-request.json --- python-neutron-lib-1.22.0/api-ref/source/v2/samples/interconnection/interconnection-update-request.json 1970-01-01 00:00:00.000000000 +0000 +++ python-neutron-lib-1.25.0/api-ref/source/v2/samples/interconnection/interconnection-update-request.json 2019-02-28 17:08:45.000000000 +0000 @@ -0,0 +1,5 @@ +{ + "interconnection": { + "name": "foo" + } +} diff -Nru python-neutron-lib-1.22.0/api-ref/source/v2/samples/interconnection/interconnection-update-response.json python-neutron-lib-1.25.0/api-ref/source/v2/samples/interconnection/interconnection-update-response.json --- python-neutron-lib-1.22.0/api-ref/source/v2/samples/interconnection/interconnection-update-response.json 1970-01-01 00:00:00.000000000 +0000 +++ python-neutron-lib-1.25.0/api-ref/source/v2/samples/interconnection/interconnection-update-response.json 2019-02-28 17:08:45.000000000 +0000 @@ -0,0 +1,16 @@ +{ + "interconnection": { + "id": "1bdffef1-fc49-4299-b9b5-005a2861e716", + "project_id": "5455570dafa34c32abb69c70005a57de", + "name": "foo", + "type": "network_l2", + "state": "VALIDATED", + "local_resource_id": "5d6820bf-a528-4e0c-85df-c2e771368d55", + "remote_resource_id": "a02d408d-7493-4291-b7bc-56894d063693", + "remote_keystone": "http://10.0.0.100/identity", + "remote_region": "RegionOne", + "remote_interconnection_id": "5f063750-ad6d-4bbe-8b82-aeb49d48ce2d", + "local_parameters": {"bgpvpn": "64512:10"}, + "remote_parameters": {} + } +} diff -Nru python-neutron-lib-1.22.0/api-ref/source/v2/samples/subnets/subnetpool-add-prefixes-request.json python-neutron-lib-1.25.0/api-ref/source/v2/samples/subnets/subnetpool-add-prefixes-request.json --- python-neutron-lib-1.22.0/api-ref/source/v2/samples/subnets/subnetpool-add-prefixes-request.json 1970-01-01 00:00:00.000000000 +0000 +++ python-neutron-lib-1.25.0/api-ref/source/v2/samples/subnets/subnetpool-add-prefixes-request.json 2019-02-28 17:08:45.000000000 +0000 @@ -0,0 +1,3 @@ +{ + "prefixes": ["192.168.0.0/24", "192.168.1.0/24", "172.16.0.0/21"] +} diff -Nru python-neutron-lib-1.22.0/api-ref/source/v2/samples/subnets/subnetpool-add-prefixes-response.json python-neutron-lib-1.25.0/api-ref/source/v2/samples/subnets/subnetpool-add-prefixes-response.json --- python-neutron-lib-1.22.0/api-ref/source/v2/samples/subnets/subnetpool-add-prefixes-response.json 1970-01-01 00:00:00.000000000 +0000 +++ python-neutron-lib-1.25.0/api-ref/source/v2/samples/subnets/subnetpool-add-prefixes-response.json 2019-02-28 17:08:45.000000000 +0000 @@ -0,0 +1,3 @@ +{ + "prefixes": ["192.168.0.0/23", "172.16.0.0/21"] +} diff -Nru python-neutron-lib-1.22.0/api-ref/source/v2/samples/subnets/subnetpool-remove-prefixes-request.json python-neutron-lib-1.25.0/api-ref/source/v2/samples/subnets/subnetpool-remove-prefixes-request.json --- python-neutron-lib-1.22.0/api-ref/source/v2/samples/subnets/subnetpool-remove-prefixes-request.json 1970-01-01 00:00:00.000000000 +0000 +++ python-neutron-lib-1.25.0/api-ref/source/v2/samples/subnets/subnetpool-remove-prefixes-request.json 2019-02-28 17:08:45.000000000 +0000 @@ -0,0 +1,3 @@ +{ + "prefixes": ["192.168.0.0/24"] +} diff -Nru python-neutron-lib-1.22.0/api-ref/source/v2/samples/subnets/subnetpool-remove-prefixes-response.json python-neutron-lib-1.25.0/api-ref/source/v2/samples/subnets/subnetpool-remove-prefixes-response.json --- python-neutron-lib-1.22.0/api-ref/source/v2/samples/subnets/subnetpool-remove-prefixes-response.json 1970-01-01 00:00:00.000000000 +0000 +++ python-neutron-lib-1.25.0/api-ref/source/v2/samples/subnets/subnetpool-remove-prefixes-response.json 2019-02-28 17:08:45.000000000 +0000 @@ -0,0 +1,3 @@ +{ + "prefixes": ["192.168.1.0/24", "172.16.0.0/21"] +} diff -Nru python-neutron-lib-1.22.0/api-ref/source/v2/subnetpool_prefix_ops.inc python-neutron-lib-1.25.0/api-ref/source/v2/subnetpool_prefix_ops.inc --- python-neutron-lib-1.22.0/api-ref/source/v2/subnetpool_prefix_ops.inc 1970-01-01 00:00:00.000000000 +0000 +++ python-neutron-lib-1.25.0/api-ref/source/v2/subnetpool_prefix_ops.inc 2019-02-28 17:08:45.000000000 +0000 @@ -0,0 +1,83 @@ +.. -*- rst -*- + +===================================================== +Subnet pool prefix operations (subnetpool-prefix-ops) +===================================================== + +Add and remove prefixes from a subnet pool prefix list. + +Add prefixes +============ + +.. rest_method:: PUT /v2.0/subnetpools/{subnetpool_id}/add_prefixes + +Adds prefixes to a subnet pool. + +Normal response codes: 200 + +Error response codes: 400, 401, 403, 404, 409, 412 + +Request +------- + +.. rest_parameters:: parameters.yaml + + - subnetpool_id: subnetpool_id + - prefixes: prefixes + +Request Example +--------------- + +.. literalinclude:: samples/subnets/subnetpool-add-prefixes-request.json + :language: javascript + +Response Parameters +------------------- + +.. rest_parameters:: parameters.yaml + + - prefixes: prefixes-response + +Response Example +---------------- + +.. literalinclude:: samples/subnets/subnetpool-add-prefixes-response.json + :language: javascript + +Remove prefixes +=============== + +.. rest_method:: PUT /v2.0/subnetpools/{subnetpool_id}/remove_prefixes + +Remove prefixes from a subnet pool. + +Normal response codes: 200 + +Error response codes: 400, 401, 403, 404, 409, 412 + +Request +------- + +.. rest_parameters:: parameters.yaml + + - subnetpool_id: subnetpool_id + - prefixes: prefixes_remove + +Request Example +--------------- + +.. literalinclude:: samples/subnets/subnetpool-remove-prefixes-request.json + :language: javascript + +Response Parameters +------------------- + +.. rest_parameters:: parameters.yaml + + - prefixes: prefixes-response + +Response Example +---------------- + +.. literalinclude:: samples/subnets/subnetpool-remove-prefixes-response.json + :language: javascript diff -Nru python-neutron-lib-1.22.0/AUTHORS python-neutron-lib-1.25.0/AUTHORS --- python-neutron-lib-1.22.0/AUTHORS 2019-01-21 20:26:17.000000000 +0000 +++ python-neutron-lib-1.25.0/AUTHORS 2019-02-28 17:11:52.000000000 +0000 @@ -27,7 +27,9 @@ Dirk Mueller Dongcan Ye Doug Hellmann +Doug Wiegley Doug Wiegley +Doug Wiegley Dustin Lundquist Felipe Monteiro Flavio Percoco @@ -89,6 +91,7 @@ Paul Carver Paul Michali Pavel Gluschak +Pawel Suder QunyingRan RYAN D. MOATS Reedip @@ -114,6 +117,7 @@ Vlad Gridin Vu Cong Tuan YAMAMOTO Takashi +Yang Youseok Yushiro FURUKAWA Zeus Arias Lucero ZhaoBo @@ -130,11 +134,14 @@ longqianzhao melissaml nanaboat +nicky nizam reedip shubhendu venkata anil yanpuqing ycx +ythomas1 zhangzs zhaorenming@inspur.com +zhufl diff -Nru python-neutron-lib-1.22.0/ChangeLog python-neutron-lib-1.25.0/ChangeLog --- python-neutron-lib-1.22.0/ChangeLog 2019-01-21 20:26:17.000000000 +0000 +++ python-neutron-lib-1.25.0/ChangeLog 2019-02-28 17:11:52.000000000 +0000 @@ -1,6 +1,49 @@ CHANGES ======= +1.25.0 +------ + +* rehome sqlalchemytypes +* Introduce subnet pool prefix operations extension +* Add exception to prevent overlapped segment ranges +* Add NETWORK\_SEGMENT\_RANGE plugin constant +* Remove ml2's accidental dependency on l3 +* 'interconnection' API extension definition (neutron-interconnection) +* rehome trunk service constants +* Catch only MessageDeliveryFailure exceptions +* Add security-group as parameter to RBAC api +* Rehome base upgrade checks class +* Remove neutron\_lib.db from db profiling projects +* Add policy module to neutron-lib +* Add setproctitle support to the workers module +* add python 3.7 unit test job +* Bump lower version of oslo.db to one that includes jitter argument +* rehome remaining common constants + +1.24.0 +------ + +* Add traffic control constants +* Exceptions for: Drive binding by placement allocation +* rehome trunk related callback resource names +* Delete floating IPs on network turned internal +* Increase tempest-full jobs timeout to 3h +* Fix exception logging formatting + +1.23.0 +------ + +* Fix pep8 E126 +* Add missing ws seperator between words +* Extend methods for network segment range support +* doc neutron-lib current +* Remove unnecessary attributes and specs from subnet\_onboard API +* New agent attribute: resources\_synced +* Use oslo.db jitter in our db retries +* Move network segment range types to lib constants +* Rehome constant: DHCPV6\_CLIENT\_PORT + 1.22.0 ------ @@ -10,12 +53,14 @@ * Modify the judgment method of CIDR and Add utests * Add network-segment-range extension API definition * sync neutron.common.exceptions into neutron-lib +* Add a new configuration parameter rpc\_response\_max\_timeout * rehome db api orm event listener functions * Revert "Add function helpers.compare\_dict" * Add traffic control exceptions * api-ref: document uplink status propagation * Handle ValueError in canonical address convertion * Update devel info: mailing list +* Add RouterNotFoundInRouterFactory exception * Change openstack-dev to openstack-discuss * Add function helpers.compare\_dict diff -Nru python-neutron-lib-1.22.0/debian/changelog python-neutron-lib-1.25.0/debian/changelog --- python-neutron-lib-1.22.0/debian/changelog 2019-01-30 17:53:17.000000000 +0000 +++ python-neutron-lib-1.25.0/debian/changelog 2019-03-11 19:41:55.000000000 +0000 @@ -1,3 +1,10 @@ +python-neutron-lib (1.25.0-0ubuntu1) disco; urgency=medium + + * New upstream release for OpenStack Stein. + * d/control: Align (Build-)Depends with upstream. + + -- Corey Bryant Mon, 11 Mar 2019 15:41:55 -0400 + python-neutron-lib (1.22.0-0ubuntu1) disco; urgency=medium * New upstream release for OpenStack Stein. diff -Nru python-neutron-lib-1.22.0/debian/control python-neutron-lib-1.25.0/debian/control --- python-neutron-lib-1.22.0/debian/control 2019-01-30 17:53:17.000000000 +0000 +++ python-neutron-lib-1.25.0/debian/control 2019-03-11 19:41:55.000000000 +0000 @@ -30,7 +30,7 @@ python-oslo.concurrency (>= 3.26.0), python-oslo.config (>= 1:5.2.0), python-oslo.context (>= 1:2.19.2), - python-oslo.db (>= 4.27.0), + python-oslo.db (>= 4.37.0), python-oslo.i18n (>= 3.15.3), python-oslo.log (>= 3.36.0), python-oslo.messaging (>= 5.29.0), @@ -42,6 +42,7 @@ python-oslotest (>= 1:3.2.0), python-osprofiler (>= 1.4.0), python-pecan (>= 1.0.0), + python-setproctitle (>= 1.1.10), python-six (>= 1.10.0), python-sqlalchemy (>= 1.2.0), python-stestr (>= 1.0.0), @@ -66,7 +67,7 @@ python3-oslo.concurrency (>= 3.26.0), python3-oslo.config (>= 1:5.2.0), python3-oslo.context (>= 1:2.19.2), - python3-oslo.db (>= 4.27.0), + python3-oslo.db (>= 4.37.0), python3-oslo.i18n (>= 3.15.3), python3-oslo.log (>= 3.36.0), python3-oslo.messaging (>= 5.29.0), @@ -79,6 +80,7 @@ python3-osprofiler (>= 1.4.0), python3-pecan (>= 1.0.0), python3-reno (>= 2.5.0), + python3-setproctitle (>= 1.1.10), python3-six (>= 1.10.0), python3-sqlalchemy (>= 1.2.0), python3-stestr (>= 1.0.0), @@ -104,7 +106,7 @@ python-oslo.concurrency (>= 3.26.0), python-oslo.config (>= 1:5.2.0), python-oslo.context (>= 1:2.19.2), - python-oslo.db (>= 4.27.0), + python-oslo.db (>= 4.37.0), python-oslo.i18n (>= 3.15.3), python-oslo.log (>= 3.36.0), python-oslo.messaging (>= 5.29.0), @@ -116,6 +118,7 @@ python-osprofiler (>= 1.4.0), python-pbr (>= 2.0.0), python-pecan (>= 1.0.0), + python-setproctitle (>= 1.1.10), python-six (>= 1.10.0), python-sqlalchemy (>= 1.2.0), python-stevedore (>= 1:1.20.0), @@ -164,7 +167,7 @@ python3-oslo.concurrency (>= 3.26.0), python3-oslo.config (>= 1:5.2.0), python3-oslo.context (>= 1:2.19.2), - python3-oslo.db (>= 4.27.0), + python3-oslo.db (>= 4.37.0), python3-oslo.i18n (>= 3.15.3), python3-oslo.log (>= 3.36.0), python3-oslo.messaging (>= 5.29.0), @@ -176,6 +179,7 @@ python3-osprofiler (>= 1.4.0), python3-pbr (>= 2.0.0), python3-pecan (>= 1.0.0), + python3-setproctitle (>= 1.1.10), python3-six (>= 1.10.0), python3-sqlalchemy (>= 1.2.0), python3-stevedore (>= 1:1.20.0), diff -Nru python-neutron-lib-1.22.0/doc/source/contributor/consuming.rst python-neutron-lib-1.25.0/doc/source/contributor/consuming.rst --- python-neutron-lib-1.22.0/doc/source/contributor/consuming.rst 1970-01-01 00:00:00.000000000 +0000 +++ python-neutron-lib-1.25.0/doc/source/contributor/consuming.rst 2019-02-28 17:08:45.000000000 +0000 @@ -0,0 +1,30 @@ +===================== +Consuming neutron-lib +===================== + +Many OpenStack projects consume neutron-lib by importing and using its code. +As a result, these consumers must define ``neutron-lib`` as a dependency in their +respective ``requirements.txt`` file. While this is likely nothing new to most +OpenStack developers, it may not be obvious to consumers if they need to always +use the latest release of neutron-lib, or if they can lag behind using an +old(er) release of it. + +The answer is that it's up to the consuming project if they want to stay +"current" or not in terms of the neutron-lib version they use. While we might +like all consumers to stay current and there are benefits to it, this isn't +always realistic for projects that have less developers/velocity. Therefore, +each project has two options for consuming neutron-lib. + +* Opt-in to stay current by adding a comment with ``neutron-lib-current`` in + their ``requirements.txt``. This string declares the project's intent to use + the latest version of neutron-lib as well as their agreement to stay current + with overall OpenStack initiatives. These projects receive updates "for free" + as part of the ongoing neutron-lib work. For more details see the + `ML archive `_ + +* Do not opt-in and rather manage your own consumption of neutron-lib. In this + case your project developers must define the version of neutron-lib to use + and update the project's code to consume it as they bump up the version. In + this scenario most projects will also be managing a back-leveled version of + ``neutron`` since neutron is always current with neutron-lib and might otherwise + break the consuming code. diff -Nru python-neutron-lib-1.22.0/doc/source/contributor/contributing.rst python-neutron-lib-1.25.0/doc/source/contributor/contributing.rst --- python-neutron-lib-1.22.0/doc/source/contributor/contributing.rst 2019-01-21 20:24:20.000000000 +0000 +++ python-neutron-lib-1.25.0/doc/source/contributor/contributing.rst 2019-02-28 17:08:45.000000000 +0000 @@ -148,6 +148,8 @@ still has direct neutron imports). The check happens daily therefore consider waiting to approve if you are either aware of another impactful change recently merged that has not been yet processed or you see failure rates spiking. +- All projects that have `neutron-lib-current `_ + should also be updated as part of consumption. Examples: diff -Nru python-neutron-lib-1.22.0/doc/source/contributor/index.rst python-neutron-lib-1.25.0/doc/source/contributor/index.rst --- python-neutron-lib-1.22.0/doc/source/contributor/index.rst 2019-01-21 20:24:20.000000000 +0000 +++ python-neutron-lib-1.25.0/doc/source/contributor/index.rst 2019-02-28 17:08:45.000000000 +0000 @@ -29,6 +29,7 @@ .. toctree:: :maxdepth: 2 + consuming conventions review-guidelines contributing diff -Nru python-neutron-lib-1.22.0/lower-constraints.txt python-neutron-lib-1.25.0/lower-constraints.txt --- python-neutron-lib-1.22.0/lower-constraints.txt 2019-01-21 20:24:20.000000000 +0000 +++ python-neutron-lib-1.25.0/lower-constraints.txt 2019-02-28 17:08:45.000000000 +0000 @@ -41,7 +41,7 @@ oslo.concurrency==3.26.0 oslo.config==5.2.0 oslo.context==2.19.2 -oslo.db==4.27.0 +oslo.db==4.37.0 oslo.i18n==3.15.3 oslo.log==3.36.0 oslo.messaging==5.29.0 @@ -78,6 +78,7 @@ requestsexceptions==1.2.0 rfc3986==0.3.1 Routes==2.3.1 +setproctitle==1.1.10 six==1.10.0 snowballstemmer==1.2.1 Sphinx==1.6.2 diff -Nru python-neutron-lib-1.22.0/neutron_lib/api/definitions/agent_resources_synced.py python-neutron-lib-1.25.0/neutron_lib/api/definitions/agent_resources_synced.py --- python-neutron-lib-1.22.0/neutron_lib/api/definitions/agent_resources_synced.py 1970-01-01 00:00:00.000000000 +0000 +++ python-neutron-lib-1.25.0/neutron_lib/api/definitions/agent_resources_synced.py 2019-02-28 17:08:45.000000000 +0000 @@ -0,0 +1,44 @@ +# Copyright (c) 2018 Ericsson +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +from neutron_lib.api.definitions import agent +from neutron_lib import constants + + +ALIAS = 'agent-resources-synced' +IS_SHIM_EXTENSION = False +IS_STANDARD_ATTR_EXTENSION = False +NAME = "Agent's Resource View Synced to Placement" +DESCRIPTION = 'Stores success/failure of last sync to Placement' +UPDATED_TIMESTAMP = '2018-12-19T00:00:00-00:00' +RESOURCE_NAME = agent.RESOURCE_NAME +COLLECTION_NAME = agent.COLLECTION_NAME +RESOURCES_SYNCED = 'resources_synced' + +RESOURCE_ATTRIBUTE_MAP = { + COLLECTION_NAME: { + RESOURCES_SYNCED: { + 'allow_post': False, + 'allow_put': False, + 'default': constants.ATTR_NOT_SPECIFIED, + 'is_visible': True, + } + } +} + +SUB_RESOURCE_ATTRIBUTE_MAP = None +ACTION_MAP = {} +ACTION_STATUS = {} +REQUIRED_EXTENSIONS = [agent.ALIAS] +OPTIONAL_EXTENSIONS = [] diff -Nru python-neutron-lib-1.22.0/neutron_lib/api/definitions/base.py python-neutron-lib-1.25.0/neutron_lib/api/definitions/base.py --- python-neutron-lib-1.22.0/neutron_lib/api/definitions/base.py 2019-01-21 20:24:20.000000000 +0000 +++ python-neutron-lib-1.25.0/neutron_lib/api/definitions/base.py 2019-02-28 17:08:45.000000000 +0000 @@ -77,6 +77,7 @@ KNOWN_EXTENSIONS = ( 'address-scope', 'agent', + 'agent-resources-synced', 'allowed-address-pairs', 'auto-allocated-topology', 'availability_zone', @@ -98,6 +99,7 @@ 'fip-port-details', 'flavors', 'floating-ip-port-forwarding', + 'floatingip-autodelete-internal', 'floatingip-pools', 'ip-substring-filtering', 'l3-ha', @@ -121,6 +123,7 @@ 'qos-rules-alias', 'quotas', 'rbac-policies', + 'rbac-security-groups', 'router', 'router_availability_zone', 'security-group', @@ -134,6 +137,7 @@ 'standard-attr-timestamp', 'subnet_allocation', 'subnet_onboard', + 'subnetpool-prefix-ops', 'subnet-segmentid-enforce', 'subnet-segmentid-writable', 'tag', @@ -158,6 +162,9 @@ # http://git.openstack.org/cgit/openstack/networking-sfc: 'flow_classifier', 'sfc', + + # http://git.openstack.org/cgit/openstack/neutron-interconnection: + 'interconnection', ) KNOWN_KEYWORDS = ( diff -Nru python-neutron-lib-1.22.0/neutron_lib/api/definitions/floatingip_autodelete_internal.py python-neutron-lib-1.25.0/neutron_lib/api/definitions/floatingip_autodelete_internal.py --- python-neutron-lib-1.22.0/neutron_lib/api/definitions/floatingip_autodelete_internal.py 1970-01-01 00:00:00.000000000 +0000 +++ python-neutron-lib-1.25.0/neutron_lib/api/definitions/floatingip_autodelete_internal.py 2019-02-28 17:08:45.000000000 +0000 @@ -0,0 +1,27 @@ +# Copyright 2019 Ericsson +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +ALIAS = 'floatingip-autodelete-internal' +IS_SHIM_EXTENSION = True +IS_STANDARD_ATTR_EXTENSION = False +NAME = 'Autodelete floating IPs of internal networks' +DESCRIPTION = 'Autodelete unused floating IPs' \ + ' of networks being turned to router:external=False' +UPDATED_TIMESTAMP = '2019-01-24T00:00:00-00:00' +RESOURCE_ATTRIBUTE_MAP = {} +SUB_RESOURCE_ATTRIBUTE_MAP = {} +ACTION_MAP = {} +REQUIRED_EXTENSIONS = [] +OPTIONAL_EXTENSIONS = [] +ACTION_STATUS = {} diff -Nru python-neutron-lib-1.22.0/neutron_lib/api/definitions/__init__.py python-neutron-lib-1.25.0/neutron_lib/api/definitions/__init__.py --- python-neutron-lib-1.22.0/neutron_lib/api/definitions/__init__.py 2019-01-21 20:24:20.000000000 +0000 +++ python-neutron-lib-1.25.0/neutron_lib/api/definitions/__init__.py 2019-02-28 17:08:45.000000000 +0000 @@ -12,6 +12,7 @@ from neutron_lib.api.definitions import address_scope from neutron_lib.api.definitions import agent +from neutron_lib.api.definitions import agent_resources_synced from neutron_lib.api.definitions import allowedaddresspairs from neutron_lib.api.definitions import auto_allocated_topology from neutron_lib.api.definitions import availability_zone @@ -42,8 +43,10 @@ from neutron_lib.api.definitions import firewallrouterinsertion from neutron_lib.api.definitions import flavors from neutron_lib.api.definitions import floating_ip_port_forwarding +from neutron_lib.api.definitions import floatingip_autodelete_internal from neutron_lib.api.definitions import floatingip_pools from neutron_lib.api.definitions import flowclassifier +from neutron_lib.api.definitions import interconnection from neutron_lib.api.definitions import ip_allocation from neutron_lib.api.definitions import ip_substring_port_filtering from neutron_lib.api.definitions import l2_adjacency @@ -79,6 +82,7 @@ from neutron_lib.api.definitions import qos_gateway_ip from neutron_lib.api.definitions import qos_rule_type_details from neutron_lib.api.definitions import qos_rules_alias +from neutron_lib.api.definitions import rbac_security_groups from neutron_lib.api.definitions import revisionifmatch from neutron_lib.api.definitions import router_availability_zone from neutron_lib.api.definitions import router_interface_fip @@ -96,6 +100,7 @@ from neutron_lib.api.definitions import subnet_segmentid_enforce from neutron_lib.api.definitions import subnet_segmentid_writable from neutron_lib.api.definitions import subnetpool +from neutron_lib.api.definitions import subnetpool_prefix_ops from neutron_lib.api.definitions import trunk from neutron_lib.api.definitions import trunk_details from neutron_lib.api.definitions import uplink_status_propagation @@ -108,6 +113,7 @@ _ALL_API_DEFINITIONS = { address_scope, agent, + agent_resources_synced, allowedaddresspairs, auto_allocated_topology, availability_zone, @@ -138,7 +144,9 @@ fip_port_details, flavors, floating_ip_port_forwarding, + floatingip_autodelete_internal, floatingip_pools, + interconnection, ip_allocation, ip_substring_port_filtering, l2_adjacency, @@ -175,6 +183,7 @@ qos_gateway_ip, qos_rule_type_details, qos_rules_alias, + rbac_security_groups, revisionifmatch, router_availability_zone, router_interface_fip, @@ -192,6 +201,7 @@ subnet_segmentid_enforce, subnet_segmentid_writable, subnetpool, + subnetpool_prefix_ops, trunk, trunk_details, uplink_status_propagation, diff -Nru python-neutron-lib-1.22.0/neutron_lib/api/definitions/interconnection.py python-neutron-lib-1.25.0/neutron_lib/api/definitions/interconnection.py --- python-neutron-lib-1.22.0/neutron_lib/api/definitions/interconnection.py 1970-01-01 00:00:00.000000000 +0000 +++ python-neutron-lib-1.25.0/neutron_lib/api/definitions/interconnection.py 2019-02-28 17:08:45.000000000 +0000 @@ -0,0 +1,125 @@ +# All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +from neutron_lib.api.definitions import l3 +from neutron_lib.db import constants as db_const + +# The alias of the extension. +ALIAS = 'interconnection' + +# Whether or not this extension is simply signaling behavior to the user +# or it actively modifies the attribute map. +IS_SHIM_EXTENSION = False + +# Whether the extension is marking the adoption of standardattr model for +# legacy resources, or introducing new standardattr attributes. False or +# None if the standardattr model is adopted since the introduction of +# resource extension. +# If this is True, the alias for the extension should be prefixed with +# 'standard-attr-'. +IS_STANDARD_ATTR_EXTENSION = False + +# The name of the extension. +NAME = 'Neutron-Neutron Interconnection' + +# The description of the extension. +DESCRIPTION = "Provides support for Neutron-Neutron Interconnections" + +# A timestamp of when the extension was introduced. +UPDATED_TIMESTAMP = "2019-01-14T16:30:00-00:00" + +API_PREFIX = 'interconnection' + +# The specific resources and/or attributes for the extension (optional). +RESOURCE_NAME = 'interconnection' +COLLECTION_NAME = 'interconnections' + +NETWORK_L2 = 'network_l2' +NETWORK_L3 = 'network_l3' +VALID_TYPES = [l3.ROUTER, NETWORK_L2, NETWORK_L3] + +# The resource attribute map for the extension. +RESOURCE_ATTRIBUTE_MAP = { + COLLECTION_NAME: { + 'id': {'allow_post': False, 'allow_put': False, + 'validate': {'type:uuid': None}, + 'is_filter': True, 'is_sort_key': True, + 'is_visible': True, + 'primary_key': True}, + 'project_id': {'allow_post': True, 'allow_put': False, + 'validate': { + 'type:string': db_const.PROJECT_ID_FIELD_SIZE}, + 'required_by_policy': True, + 'is_filter': True, 'is_sort_key': True, + 'is_visible': True}, + 'name': {'allow_post': True, 'allow_put': True, + 'default': '', + 'validate': {'type:string': db_const.NAME_FIELD_SIZE}, + 'is_filter': True, 'is_sort_key': True, + 'is_visible': True}, + 'type': {'allow_post': True, 'allow_put': False, + 'validate': {'type:values': VALID_TYPES}, + 'is_filter': True, 'is_sort_key': True, + 'is_visible': True}, + 'state': {'allow_post': False, 'allow_put': False, + 'is_filter': True, 'is_sort_key': True, + 'is_visible': True}, + 'local_resource_id': {'allow_post': True, 'allow_put': False, + 'validate': {'type:uuid': None}, + 'is_visible': True}, + 'remote_resource_id': {'allow_post': True, 'allow_put': False, + 'validate': {'type:uuid': None}, + 'is_visible': True}, + 'remote_keystone': {'allow_post': True, 'allow_put': False, + 'validate': {'type:string_or_none': None}, + 'is_visible': True}, + 'remote_region': {'allow_post': True, 'allow_put': False, + 'validate': {'type:string_or_none': None}, + 'is_visible': True}, + 'remote_interconnection_id': {'allow_post': False, 'allow_put': False, + 'validate': {'type:uuid_or_none': None}, + 'is_visible': True}, + 'local_parameters': {'allow_post': False, 'allow_put': False, + 'is_visible': True}, + 'remote_parameters': {'allow_post': False, 'allow_put': False, + 'is_visible': True} + }, +} + +# The subresource attribute map for the extension. It adds child resources +# to main extension's resource. The subresource map must have a parent and +# a parameters entry. If an extension does not need such a map, None can +# be specified (mandatory). +SUB_RESOURCE_ATTRIBUTE_MAP = None + +# The action map: it associates verbs with methods to be performed on +# the API resource. +ACTION_MAP = { + RESOURCE_NAME: { + 'refresh': 'PUT' + } +} + +# The action status. +ACTION_STATUS = { +} + +# The list of required extensions. +REQUIRED_EXTENSIONS = [ + l3.ALIAS +] + +# The list of optional extensions. +OPTIONAL_EXTENSIONS = [ +] diff -Nru python-neutron-lib-1.22.0/neutron_lib/api/definitions/network_segment_range.py python-neutron-lib-1.25.0/neutron_lib/api/definitions/network_segment_range.py --- python-neutron-lib-1.22.0/neutron_lib/api/definitions/network_segment_range.py 2019-01-21 20:24:20.000000000 +0000 +++ python-neutron-lib-1.25.0/neutron_lib/api/definitions/network_segment_range.py 2019-02-28 17:08:45.000000000 +0000 @@ -35,11 +35,6 @@ # The plural for the resource. COLLECTION_NAME = 'network_segment_ranges' -NETWORK_SEGMENT_RANGE_TYPE_LIST = [constants.TYPE_VLAN, - constants.TYPE_VXLAN, - constants.TYPE_GRE, - constants.TYPE_GENEVE] - # Min ID for VLAN, VXLAN, GRE and GENEVE all equal to 1; Max ID for them are # 4094, 2 ** 24 - 1, 2 ** 32 - 1 and 2 ** 24 - 1 respectively. # Take the largest range: [MIN_GRE_ID, MAX_GRE_ID] as the limit for validation. @@ -82,7 +77,8 @@ 'network_type': {'allow_post': True, 'allow_put': False, 'validate': { - 'type:values': NETWORK_SEGMENT_RANGE_TYPE_LIST}, + 'type:values': + constants.NETWORK_SEGMENT_RANGE_TYPES}, 'default': constants.ATTR_NOT_SPECIFIED, 'is_filter': True, 'is_visible': True}, diff -Nru python-neutron-lib-1.22.0/neutron_lib/api/definitions/qos_rules_alias.py python-neutron-lib-1.25.0/neutron_lib/api/definitions/qos_rules_alias.py --- python-neutron-lib-1.22.0/neutron_lib/api/definitions/qos_rules_alias.py 2019-01-21 20:24:20.000000000 +0000 +++ python-neutron-lib-1.25.0/neutron_lib/api/definitions/qos_rules_alias.py 2019-02-28 17:08:45.000000000 +0000 @@ -50,14 +50,14 @@ BANDWIDTH_LIMIT_RULES_ALIAS: dict( _QOS_RULE_COMMON_FIELDS, **{q_const.MAX_KBPS: { - 'allow_post': False, 'allow_put': True, - 'convert_to': converters.convert_to_int, - 'is_visible': True, - 'is_filter': True, - 'is_sort_key': True, - 'validate': { - 'type:range': [0, db_const.DB_INTEGER_MAX_VALUE] - } + 'allow_post': False, 'allow_put': True, + 'convert_to': converters.convert_to_int, + 'is_visible': True, + 'is_filter': True, + 'is_sort_key': True, + 'validate': { + 'type:range': [0, db_const.DB_INTEGER_MAX_VALUE] + } }, q_const.DIRECTION: { 'allow_post': False, @@ -77,33 +77,33 @@ 'is_sort_key': True, 'convert_to': converters.convert_to_int, 'validate': { - 'type:range': [0, db_const.DB_INTEGER_MAX_VALUE] + 'type:range': [0, db_const.DB_INTEGER_MAX_VALUE] } }}), DSCP_MARKING_RULES_ALIAS: dict( _QOS_RULE_COMMON_FIELDS, **{q_const.DSCP_MARK: { - 'allow_post': False, 'allow_put': True, - 'convert_to': converters.convert_to_int, - 'is_visible': True, - 'is_filter': True, - 'is_sort_key': True, - 'validate': { - 'type:values': constants.VALID_DSCP_MARKS - } + 'allow_post': False, 'allow_put': True, + 'convert_to': converters.convert_to_int, + 'is_visible': True, + 'is_filter': True, + 'is_sort_key': True, + 'validate': { + 'type:values': constants.VALID_DSCP_MARKS + } }}), MIN_BANDWIDTH_RULES_ALIAS: dict( - _QOS_RULE_COMMON_FIELDS, - **{q_const.MIN_KBPS: { - 'allow_post': False, 'allow_put': True, - 'is_visible': True, - 'is_filter': True, - 'is_sort_key': True, - 'convert_to': converters.convert_to_int, - 'validate': { - 'type:range': [0, db_const.DB_INTEGER_MAX_VALUE] - } - }, + _QOS_RULE_COMMON_FIELDS, + **{q_const.MIN_KBPS: { + 'allow_post': False, 'allow_put': True, + 'is_visible': True, + 'is_filter': True, + 'is_sort_key': True, + 'convert_to': converters.convert_to_int, + 'validate': { + 'type:range': [0, db_const.DB_INTEGER_MAX_VALUE] + } + }, q_const.DIRECTION: { 'allow_post': False, 'allow_put': True, 'is_visible': True, 'default': constants.EGRESS_DIRECTION, @@ -112,8 +112,8 @@ 'validate': { 'type:values': constants.VALID_DIRECTIONS } - } } + } ) } SUB_RESOURCE_ATTRIBUTE_MAP = {} diff -Nru python-neutron-lib-1.22.0/neutron_lib/api/definitions/rbac_security_groups.py python-neutron-lib-1.25.0/neutron_lib/api/definitions/rbac_security_groups.py --- python-neutron-lib-1.22.0/neutron_lib/api/definitions/rbac_security_groups.py 1970-01-01 00:00:00.000000000 +0000 +++ python-neutron-lib-1.25.0/neutron_lib/api/definitions/rbac_security_groups.py 2019-02-28 17:08:45.000000000 +0000 @@ -0,0 +1,24 @@ +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +ALIAS = 'rbac-security-groups' +IS_SHIM_EXTENSION = True +IS_STANDARD_ATTR_EXTENSION = False +NAME = 'Add security_group type to network RBAC' +DESCRIPTION = 'Add security_group type to network RBAC' +UPDATED_TIMESTAMP = '2019-02-14T00:00:00-00:00' +RESOURCE_ATTRIBUTE_MAP = {} +SUB_RESOURCE_ATTRIBUTE_MAP = {} +ACTION_MAP = {} +REQUIRED_EXTENSIONS = ['rbac-policies', 'security-group'] +OPTIONAL_EXTENSIONS = [] +ACTION_STATUS = {} diff -Nru python-neutron-lib-1.22.0/neutron_lib/api/definitions/subnet_onboard.py python-neutron-lib-1.25.0/neutron_lib/api/definitions/subnet_onboard.py --- python-neutron-lib-1.22.0/neutron_lib/api/definitions/subnet_onboard.py 2019-01-21 20:24:20.000000000 +0000 +++ python-neutron-lib-1.25.0/neutron_lib/api/definitions/subnet_onboard.py 2019-02-28 17:08:45.000000000 +0000 @@ -14,8 +14,6 @@ # License for the specific language governing permissions and limitations # under the License. -from neutron_lib.api import converters -from neutron_lib.api.definitions import subnet as subnet_def from neutron_lib.api.definitions import subnetpool as subnetpool_def import neutron_lib.constants @@ -24,28 +22,14 @@ IS_STANDARD_ATTR_EXTENSION = False NAME = "Subnet Onboard" DESCRIPTION = "Provides support for onboarding subnets into subnet pools" -UPDATED_TIMESTAMP = "2017-07-27T10:00:00-00:00" +UPDATED_TIMESTAMP = "2018-12-18T09:00:00-00:00" ONBOARD_SUBNETS = 'onboard_network_subnets' -ONBOARD_SUBNETS_SPECS = { - 'id': {'type:uuid': None, 'required': True}, - 'network_id': {'type:uuid': None, 'required': True}, - 'ip_version': {'convert_to': converters.convert_to_int, - 'type:values': [4, 6], - 'required': True} -} - RESOURCE_ATTRIBUTE_MAP = { subnetpool_def.COLLECTION_NAME: { - subnet_def.COLLECTION_NAME: { - 'allow_post': True, 'allow_put': True, 'default': [], - 'validate': { - 'type:list_of_any_key_specs_or_none': ONBOARD_SUBNETS_SPECS - } - } } } diff -Nru python-neutron-lib-1.22.0/neutron_lib/api/definitions/subnetpool_prefix_ops.py python-neutron-lib-1.25.0/neutron_lib/api/definitions/subnetpool_prefix_ops.py --- python-neutron-lib-1.22.0/neutron_lib/api/definitions/subnetpool_prefix_ops.py 1970-01-01 00:00:00.000000000 +0000 +++ python-neutron-lib-1.25.0/neutron_lib/api/definitions/subnetpool_prefix_ops.py 2019-02-28 17:08:45.000000000 +0000 @@ -0,0 +1,53 @@ +# (c) Copyright 2019 SUSE LLC +# +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +from neutron_lib.api.definitions import subnetpool as subnetpool_def +from neutron_lib import constants + +ALIAS = "subnetpool-prefix-ops" +IS_SHIM_EXTENSION = False +IS_STANDARD_ATTR_EXTENSION = False +NAME = "Subnet Pool Prefix Operations" +DESCRIPTION = "Provides support for adjusting the prefix list of subnet pools" +UPDATED_TIMESTAMP = "2019-02-08T10:00:00-00:00" + + +RESOURCE_ATTRIBUTE_MAP = { +} + +# The subresource attribute map for the extension. This extension has only +# top level resources, not child resources, so this is set to an empty dict. +SUB_RESOURCE_ATTRIBUTE_MAP = { +} + +# The action map. +ACTION_MAP = { + subnetpool_def.RESOURCE_NAME: { + 'add_prefixes': 'PUT', + 'remove_prefixes': 'PUT' + } +} + +# The action status. +ACTION_STATUS = { +} + +# The list of required extensions. +REQUIRED_EXTENSIONS = [constants.SUBNET_ALLOCATION_EXT_ALIAS] + +# The list of optional extensions. +OPTIONAL_EXTENSIONS = [ +] diff -Nru python-neutron-lib-1.22.0/neutron_lib/api/validators/__init__.py python-neutron-lib-1.25.0/neutron_lib/api/validators/__init__.py --- python-neutron-lib-1.22.0/neutron_lib/api/validators/__init__.py 2019-01-21 20:24:20.000000000 +0000 +++ python-neutron-lib-1.25.0/neutron_lib/api/validators/__init__.py 2019-02-28 17:08:45.000000000 +0000 @@ -162,7 +162,7 @@ return msg except TypeError: # This is a programming error - msg = (_("'data' of type '%(typedata)s' and 'valid_values'" + msg = (_("'data' of type '%(typedata)s' and 'valid_values' " "of type '%(typevalues)s' are not " "compatible for comparison") % {'typedata': type(data), diff -Nru python-neutron-lib-1.22.0/neutron_lib/callbacks/resources.py python-neutron-lib-1.25.0/neutron_lib/callbacks/resources.py --- python-neutron-lib-1.22.0/neutron_lib/callbacks/resources.py 2019-01-21 20:24:20.000000000 +0000 +++ python-neutron-lib-1.25.0/neutron_lib/callbacks/resources.py 2019-02-28 17:08:45.000000000 +0000 @@ -32,3 +32,6 @@ SUBNET = 'subnet' SUBNETS = 'subnets' SUBNETPOOL_ADDRESS_SCOPE = 'subnetpool_address_scope' +SUBPORTS = 'subports' +TRUNK = 'trunk' +TRUNK_PLUGIN = 'trunk_plugin' diff -Nru python-neutron-lib-1.22.0/neutron_lib/constants.py python-neutron-lib-1.25.0/neutron_lib/constants.py --- python-neutron-lib-1.22.0/neutron_lib/constants.py 2019-01-21 20:24:20.000000000 +0000 +++ python-neutron-lib-1.25.0/neutron_lib/constants.py 2019-02-28 17:08:45.000000000 +0000 @@ -97,6 +97,7 @@ IPv6_LLA_PREFIX = 'fe80::/64' DHCP_RESPONSE_PORT = 68 +DHCPV6_CLIENT_PORT = 546 FLOODING_ENTRY = ('00:00:00:00:00:00', '0.0.0.0') @@ -289,6 +290,9 @@ TYPE_VLAN = 'vlan' TYPE_NONE = 'none' +# List of supported network segment range types +NETWORK_SEGMENT_RANGE_TYPES = [TYPE_VLAN, TYPE_VXLAN, TYPE_GRE, TYPE_GENEVE] + # Values for network_type # For VLAN Network @@ -330,6 +334,17 @@ PROVISIONAL_IPV6_PD_PREFIX = '::/64' +# Traffic control +TC_QDISC_TYPE_HTB = 'htb' +TC_QDISC_TYPE_TBF = 'tbf' +TC_QDISC_TYPE_INGRESS = 'ingress' +TC_QDISC_TYPES = (TC_QDISC_TYPE_HTB, TC_QDISC_TYPE_TBF, TC_QDISC_TYPE_INGRESS) + +TC_QDISC_INGRESS_ID = 'ffff:' + +TC_QDISC_PARENTS = {'root': 0xffffffff, + 'ingress': 0xfffffff1} + class Sentinel(object): """A constant object that does not change even when copied.""" @@ -367,3 +382,230 @@ VETH_DEVICE_PREFIX = 'qvo' # prefix for SNAT interface in DVR SNAT_INT_DEV_PREFIX = 'sg-' + + +ROUTER_PORT_OWNERS = ROUTER_INTERFACE_OWNERS_SNAT + (DEVICE_OWNER_ROUTER_GW,) + +ROUTER_STATUS_ACTIVE = 'ACTIVE' +ROUTER_STATUS_ALLOCATING = 'ALLOCATING' +ROUTER_STATUS_ERROR = 'ERROR' + +VALID_ROUTER_STATUS = (ROUTER_STATUS_ACTIVE, + ROUTER_STATUS_ALLOCATING, + ROUTER_STATUS_ERROR) + +HA_ROUTER_STATE_KEY = '_ha_state' +METERING_LABEL_KEY = '_metering_labels' +FLOATINGIP_AGENT_INTF_KEY = '_floatingip_agent_interfaces' +SNAT_ROUTER_INTF_KEY = '_snat_router_interfaces' + +HA_NETWORK_NAME = 'HA network tenant %s' +HA_SUBNET_NAME = 'HA subnet tenant %s' +HA_PORT_NAME = 'HA port tenant %s' +HA_ROUTER_STATE_ACTIVE = 'active' +HA_ROUTER_STATE_STANDBY = 'standby' +HA_ROUTER_STATE_UNKNOWN = 'unknown' +VALID_HA_STATES = (HA_ROUTER_STATE_ACTIVE, HA_ROUTER_STATE_STANDBY, + HA_ROUTER_STATE_UNKNOWN) + +PAGINATION_INFINITE = 'infinite' + +SORT_DIRECTION_ASC = 'asc' +SORT_DIRECTION_DESC = 'desc' + +ETHERTYPE_NAME_ARP = 'arp' +ETHERTYPE_ARP = 0x0806 +ETHERTYPE_IP = 0x0800 +ETHERTYPE_IPV6 = 0x86DD + +IP_PROTOCOL_NAME_ALIASES = {PROTO_NAME_IPV6_ICMP_LEGACY: + PROTO_NAME_IPV6_ICMP} + +IP_PROTOCOL_NUM_TO_NAME_MAP = {str(v): k for k, v in IP_PROTOCOL_MAP.items()} + +# When using iptables-save we specify '-p {proto}', +# but sometimes those values are not identical. This is a map +# of known protocol numbers that require a name to be used and +# protocol names that require a different name to be used, +# because that is how iptables-save will display them. +# +# This is how the list was created, so there is a possibility +# it will need to be updated in the future: +# +# $ for num in {0..255}; do iptables -A INPUT -p $num; done +# $ iptables-save +# +# These cases are special, and were found by inspection: +# - 'ipv6-encap' uses 'ipv6' +# - 'icmpv6' uses 'ipv6-icmp' +# - 'pgm' uses '113' instead of its name +# - protocol '0' uses no -p argument +IPTABLES_PROTOCOL_NAME_MAP = {PROTO_NAME_IPV6_ENCAP: 'ipv6', + PROTO_NAME_IPV6_ICMP_LEGACY: + 'ipv6-icmp', + PROTO_NAME_PGM: '113', + '0': None, + '1': 'icmp', + '2': 'igmp', + '3': 'ggp', + '4': 'ipencap', + '5': 'st', + '6': 'tcp', + '8': 'egp', + '9': 'igp', + '12': 'pup', + '17': 'udp', + '20': 'hmp', + '22': 'xns-idp', + '27': 'rdp', + '29': 'iso-tp4', + '33': 'dccp', + '36': 'xtp', + '37': 'ddp', + '38': 'idpr-cmtp', + '41': 'ipv6', + '43': 'ipv6-route', + '44': 'ipv6-frag', + '45': 'idrp', + '46': 'rsvp', + '47': 'gre', + '50': 'esp', + '51': 'ah', + '57': 'skip', + '58': 'ipv6-icmp', + '59': 'ipv6-nonxt', + '60': 'ipv6-opts', + '73': 'rspf', + '81': 'vmtp', + '88': 'eigrp', + '89': 'ospf', + '93': 'ax.25', + '94': 'ipip', + '97': 'etherip', + '98': 'encap', + '103': 'pim', + '108': 'ipcomp', + '112': 'vrrp', + '115': 'l2tp', + '124': 'isis', + '132': 'sctp', + '133': 'fc', + '135': 'mobility-header', + '136': 'udplite', + '137': 'mpls-in-ip', + '138': 'manet', + '139': 'hip', + '140': 'shim6', + '141': 'wesp', + '142': 'rohc'} + +# A length of a iptables chain name must be less than or equal to 11 +# characters. +# - ( + '-') = 28-(16+1) = 11 +MAX_IPTABLES_CHAIN_LEN_WRAP = 11 +MAX_IPTABLES_CHAIN_LEN_NOWRAP = 28 + +# Timeout in seconds for getting an IPv6 LLA +LLA_TASK_TIMEOUT = 40 + +# length of all device prefixes (e.g. qvo, tap, qvb) +LINUX_DEV_PREFIX_LEN = 3 +# must be shorter than linux IFNAMSIZ (which is 16) +LINUX_DEV_LEN = 14 + +# Possible prefixes to partial port IDs in interface names used by the OVS, +# Linux Bridge, and IVS VIF drivers in Nova and the neutron agents. See the +# 'get_ovs_interfaceid' method in Nova (nova/virt/libvirt/vif.py) for details. +INTERFACE_PREFIXES = (TAP_DEVICE_PREFIX, + VETH_DEVICE_PREFIX, + SNAT_INT_DEV_PREFIX) + +ATTRIBUTES_TO_UPDATE = 'attributes_to_update' + +# TODO(amuller): Re-define the RPC namespaces once Oslo messaging supports +# Targets with multiple namespaces. Neutron will then implement callbacks +# for its RPC clients in order to support rolling upgrades. + +# RPC Interface for agents to call DHCP API implemented on the plugin side +RPC_NAMESPACE_DHCP_PLUGIN = None +# RPC interface for the metadata service to get info from the plugin side +RPC_NAMESPACE_METADATA = None +# RPC interface for agent to plugin security group API +RPC_NAMESPACE_SECGROUP = None +# RPC interface for agent to plugin DVR api +RPC_NAMESPACE_DVR = None +# RPC interface for reporting state back to the plugin +RPC_NAMESPACE_STATE = None +# RPC interface for agent to plugin resources API +RPC_NAMESPACE_RESOURCES = None + +# Default network MTU value when not configured +DEFAULT_NETWORK_MTU = 1500 +IPV6_MIN_MTU = 1280 + +ROUTER_MARK_MASK = "0xffff" + +VALID_ETHERTYPES = (IPv4, IPv6) + +IP_ALLOWED_VERSIONS = [IP_VERSION_4, IP_VERSION_6] + +PORT_RANGE_MIN = 1 +PORT_RANGE_MAX = 65535 + +DHCPV6_CLIENT_PORT = 546 + +# Configuration values for accept_ra sysctl, copied from linux kernel +# networking (netdev) tree, file Documentation/networking/ip-sysctl.txt +# +# Possible values are: +# 0 Do not accept Router Advertisements. +# 1 Accept Router Advertisements if forwarding is disabled. +# 2 Overrule forwarding behaviour. Accept Router Advertisements +# even if forwarding is enabled. +ACCEPT_RA_DISABLED = 0 +ACCEPT_RA_WITHOUT_FORWARDING = 1 +ACCEPT_RA_WITH_FORWARDING = 2 + +# Some components communicate using private address ranges, define +# them all here. These address ranges should not cause any issues +# even if they overlap since they are used in disjoint namespaces, +# but for now they are unique. +# We define the metadata cidr since it falls in the range. +PRIVATE_CIDR_RANGE = '169.254.0.0/16' +DVR_FIP_LL_CIDR = '169.254.64.0/18' +L3_HA_NET_CIDR = '169.254.192.0/18' +METADATA_CIDR = '169.254.169.254/32' + +# The only defined IpamAllocation status at this stage is 'ALLOCATED'. +# More states will be available in the future - e.g.: RECYCLABLE +IPAM_ALLOCATION_STATUS_ALLOCATED = 'ALLOCATED' + +VALID_IPAM_ALLOCATION_STATUSES = (IPAM_ALLOCATION_STATUS_ALLOCATED,) + +# Port binding states for Live Migration +PORT_BINDING_STATUSES = (ACTIVE, + INACTIVE) + +VALID_FLOATINGIP_STATUS = (FLOATINGIP_STATUS_ACTIVE, + FLOATINGIP_STATUS_DOWN, + FLOATINGIP_STATUS_ERROR) + +# Floating IP host binding states +FLOATING_IP_HOST_UNBOUND = "FLOATING_IP_HOST_UNBOUND" +FLOATING_IP_HOST_NEEDS_BINDING = "FLOATING_IP_HOST_NEEDS_BINDING" + +# Possible types of values (e.g. in QoS rule types) +VALUES_TYPE_CHOICES = "choices" +VALUES_TYPE_RANGE = "range" + +# Units base +SI_BASE = 1000 +IEC_BASE = 1024 + +# Port bindings handling +NO_ACTIVE_BINDING = 'no_active_binding' + +EXT_PARENT_PREFIX = 'ext_parent' + +RP_BANDWIDTHS = 'resource_provider_bandwidths' +RP_INVENTORY_DEFAULTS = 'resource_provider_inventory_defaults' diff -Nru python-neutron-lib-1.22.0/neutron_lib/context.py python-neutron-lib-1.25.0/neutron_lib/context.py --- python-neutron-lib-1.22.0/neutron_lib/context.py 2019-01-21 20:24:20.000000000 +0000 +++ python-neutron-lib-1.25.0/neutron_lib/context.py 2019-02-28 17:08:45.000000000 +0000 @@ -20,8 +20,8 @@ from oslo_context import context as oslo_context from oslo_db.sqlalchemy import enginefacade -from neutron_lib import _policy as policy from neutron_lib.db import api as db_api +from neutron_lib.policy import _engine as policy_engine class ContextBase(oslo_context.RequestContext): @@ -50,9 +50,10 @@ self.timestamp = timestamp self.is_advsvc = is_advsvc if self.is_advsvc is None: - self.is_advsvc = self.is_admin or policy.check_is_advsvc(self) + self.is_advsvc = (self.is_admin or + policy_engine.check_is_advsvc(self)) if self.is_admin is None: - self.is_admin = policy.check_is_admin(self) + self.is_admin = policy_engine.check_is_admin(self) @property def tenant_id(self): diff -Nru python-neutron-lib-1.22.0/neutron_lib/db/api.py python-neutron-lib-1.25.0/neutron_lib/db/api.py --- python-neutron-lib-1.22.0/neutron_lib/db/api.py 2019-01-21 20:24:20.000000000 +0000 +++ python-neutron-lib-1.25.0/neutron_lib/db/api.py 2019-02-28 17:08:45.000000000 +0000 @@ -38,7 +38,6 @@ MAX_RETRIES = 20 -OSPROFILER_TRACE_NAMES = {'neutron.db', 'neutron_lib.db'} LOG = logging.getLogger(__name__) _synchronized = lockutils.synchronized_with_prefix("neutron-") _CTX_MANAGER = None @@ -68,9 +67,8 @@ def _set_hook(engine): if (profiler_opts.is_trace_enabled() and profiler_opts.is_db_trace_enabled()): - for trace_name in OSPROFILER_TRACE_NAMES: - osprofiler.sqlalchemy.add_tracing( - sqlalchemy, engine, trace_name) + osprofiler.sqlalchemy.add_tracing( + sqlalchemy, engine, "neutron.db") # TODO(ihrachys) the hook assumes options defined by osprofiler, and the only @@ -151,7 +149,8 @@ max_retries=MAX_RETRIES, retry_interval=0.5, inc_retry_interval=True, - exception_checker=is_retriable + exception_checker=is_retriable, + jitter=True ) diff -Nru python-neutron-lib-1.22.0/neutron_lib/db/sqlalchemytypes.py python-neutron-lib-1.25.0/neutron_lib/db/sqlalchemytypes.py --- python-neutron-lib-1.22.0/neutron_lib/db/sqlalchemytypes.py 1970-01-01 00:00:00.000000000 +0000 +++ python-neutron-lib-1.25.0/neutron_lib/db/sqlalchemytypes.py 2019-02-28 17:08:45.000000000 +0000 @@ -0,0 +1,83 @@ +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +"""Custom SQLAlchemy types.""" + +import netaddr +from sqlalchemy import types + +from neutron_lib._i18n import _ + + +class IPAddress(types.TypeDecorator): + + impl = types.String(64) + + def process_result_value(self, value, dialect): + return netaddr.IPAddress(value) + + def process_bind_param(self, value, dialect): + if not isinstance(value, netaddr.IPAddress): + raise AttributeError(_("Received type '%(type)s' and value " + "'%(value)s'. Expecting netaddr.IPAddress " + "type.") % {'type': type(value), + 'value': value}) + + return str(value) + + +class CIDR(types.TypeDecorator): + + impl = types.String(64) + + def process_result_value(self, value, dialect): + return netaddr.IPNetwork(value) + + def process_bind_param(self, value, dialect): + if not isinstance(value, netaddr.IPNetwork): + raise AttributeError(_("Received type '%(type)s' and value " + "'%(value)s'. Expecting netaddr.IPNetwork " + "type.") % {'type': type(value), + 'value': value}) + return str(value) + + +class MACAddress(types.TypeDecorator): + + impl = types.String(64) + + def process_result_value(self, value, dialect): + return netaddr.EUI(value) + + def process_bind_param(self, value, dialect): + if not isinstance(value, netaddr.EUI): + raise AttributeError(_("Received type '%(type)s' and value " + "'%(value)s'. Expecting netaddr.EUI " + "type.") % {'type': type(value), + 'value': value}) + return str(value) + + +class TruncatedDateTime(types.TypeDecorator): + """Truncates microseconds. + + Use this for datetime fields so we don't have to worry about DB-specific + behavior when it comes to rounding/truncating microseconds off of + timestamps. + """ + + impl = types.DateTime + + def process_bind_param(self, value, dialect): + return value.replace(microsecond=0) if value else value + + process_result_value = process_bind_param diff -Nru python-neutron-lib-1.22.0/neutron_lib/exceptions/l3.py python-neutron-lib-1.25.0/neutron_lib/exceptions/l3.py --- python-neutron-lib-1.22.0/neutron_lib/exceptions/l3.py 2019-01-21 20:24:20.000000000 +0000 +++ python-neutron-lib-1.25.0/neutron_lib/exceptions/l3.py 2019-02-28 17:08:45.000000000 +0000 @@ -77,6 +77,11 @@ message = _("Router '%(router_id)s' is not compatible with this agent.") +class RouterNotFoundInRouterFactory(exceptions.NeutronException): + message = _("Router '%(router_id)s' with features '%(features)s' could " + "not be found in the router factory.") + + class FloatingIpSetupException(exceptions.NeutronException): def __init__(self, message=None): self.message = message diff -Nru python-neutron-lib-1.22.0/neutron_lib/exceptions/network_segment_range.py python-neutron-lib-1.25.0/neutron_lib/exceptions/network_segment_range.py --- python-neutron-lib-1.22.0/neutron_lib/exceptions/network_segment_range.py 2019-01-21 20:24:20.000000000 +0000 +++ python-neutron-lib-1.25.0/neutron_lib/exceptions/network_segment_range.py 2019-02-28 17:08:45.000000000 +0000 @@ -33,3 +33,8 @@ class NetworkSegmentRangeDefaultReadOnly(exceptions.NeutronException): message = _("Network Segment Range %(range_id)s is a " "default segment range which could not be updated or deleted.") + + +class NetworkSegmentRangeOverlaps(exceptions.Conflict): + message = _("Network segment range overlaps with range(s) " + "with id %(range_id)s") diff -Nru python-neutron-lib-1.22.0/neutron_lib/exceptions/placement.py python-neutron-lib-1.25.0/neutron_lib/exceptions/placement.py --- python-neutron-lib-1.22.0/neutron_lib/exceptions/placement.py 2019-01-21 20:24:20.000000000 +0000 +++ python-neutron-lib-1.25.0/neutron_lib/exceptions/placement.py 2019-02-28 17:08:45.000000000 +0000 @@ -58,7 +58,7 @@ class PlacementAPIVersionIncorrect(exceptions.NotFound): - message = _("Placement API version %(current_version)s, do not meet the" + message = _("Placement API version %(current_version)s, do not meet the " "needed version %(needed_version)s.") @@ -69,3 +69,14 @@ class PlacementClientError(exceptions.NeutronException): message = _("Placement Client Error (4xx): %(msg)s") + + +class UnknownResourceProvider(exceptions.BadRequest): + """Resource provider not known by neutron backends.""" + message = _("No such resource provider known by Neutron: %(rsc_provider)s") + + +class AmbiguousResponsibilityForResourceProvider(exceptions.NeutronException): + """Not clear who's responsible for resource provider.""" + message = _("Expected one driver to be responsible for resource provider " + "%(rsc_provider)s, but got many: %(drivers)s") diff -Nru python-neutron-lib-1.22.0/neutron_lib/plugins/constants.py python-neutron-lib-1.25.0/neutron_lib/plugins/constants.py --- python-neutron-lib-1.22.0/neutron_lib/plugins/constants.py 2019-01-21 20:24:20.000000000 +0000 +++ python-neutron-lib-1.25.0/neutron_lib/plugins/constants.py 2019-02-28 17:08:45.000000000 +0000 @@ -25,3 +25,4 @@ LOG_API = "LOGGING" PORTFORWARDING = "PORTFORWARDING" FLOATINGIPPOOL = "FLOATINGIPPOOL" +NETWORK_SEGMENT_RANGE = "NETWORK_SEGMENT_RANGE" diff -Nru python-neutron-lib-1.22.0/neutron_lib/plugins/ml2/api.py python-neutron-lib-1.25.0/neutron_lib/plugins/ml2/api.py --- python-neutron-lib-1.22.0/neutron_lib/plugins/ml2/api.py 2019-01-21 20:24:20.000000000 +0000 +++ python-neutron-lib-1.25.0/neutron_lib/plugins/ml2/api.py 2019-02-28 17:08:45.000000000 +0000 @@ -534,11 +534,12 @@ """ @abc.abstractmethod - def reserve_provider_segment(self, session, segment): + def reserve_provider_segment(self, session, segment, filters=None): """Reserve resource associated with a provider network segment. :param session: database session :param segment: segment dictionary + :param filters: a dictionary that is used as search criteria :returns: segment dictionary Called inside transaction context on session to reserve the @@ -549,10 +550,11 @@ pass @abc.abstractmethod - def allocate_tenant_segment(self, session): + def allocate_tenant_segment(self, session, filters=None): """Allocate resource for a new tenant network segment. :param session: database session + :param filters: a dictionary that is used as search criteria :returns: segment dictionary using keys defined above Called inside transaction context on session to allocate a new @@ -604,11 +606,12 @@ """ @abc.abstractmethod - def reserve_provider_segment(self, context, segment): + def reserve_provider_segment(self, context, segment, filters=None): """Reserve resource associated with a provider network segment. :param context: instance of neutron context with DB session :param segment: segment dictionary + :param filters: a dictionary that is used as search criteria :returns: segment dictionary Called inside transaction context on session to reserve the @@ -619,10 +622,11 @@ pass @abc.abstractmethod - def allocate_tenant_segment(self, context): + def allocate_tenant_segment(self, context, filters=None): """Allocate resource for a new tenant network segment. :param context: instance of neutron context with DB session + :param filters: a dictionary that is used as search criteria :returns: segment dictionary using keys defined above Called inside transaction context on session to allocate a new diff -Nru python-neutron-lib-1.22.0/neutron_lib/policy/_engine.py python-neutron-lib-1.25.0/neutron_lib/policy/_engine.py --- python-neutron-lib-1.22.0/neutron_lib/policy/_engine.py 1970-01-01 00:00:00.000000000 +0000 +++ python-neutron-lib-1.25.0/neutron_lib/policy/_engine.py 2019-02-28 17:08:45.000000000 +0000 @@ -0,0 +1,110 @@ +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +import sys + +from oslo_config import cfg +from oslo_policy import policy + + +_ROLE_ENFORCER = None +_ADMIN_CTX_POLICY = 'context_is_admin' +_ADVSVC_CTX_POLICY = 'context_is_advsvc' + + +_BASE_RULES = [ + policy.RuleDefault( + _ADMIN_CTX_POLICY, + 'role:admin', + description='Rule for cloud admin access'), + policy.RuleDefault( + _ADVSVC_CTX_POLICY, + 'role:advsvc', + description='Rule for advanced service role access'), +] + + +def init(conf=cfg.CONF, policy_file=None): + """Initialize the global enforcer if not already initialized. + + Initialize the global enforcer (and load its rules) if not already + initialized; otherwise this is a no-op. + + :param conf: The configuration to initialize the global enforcer with. + Defaults to oslo_config.cfg.CONF. + :param policy_file: The policy file to initialize the global enforcer + with. + :returns: None. + """ + + global _ROLE_ENFORCER + if not _ROLE_ENFORCER: + _ROLE_ENFORCER = policy.Enforcer(conf, policy_file=policy_file) + _ROLE_ENFORCER.register_defaults(_BASE_RULES) + _ROLE_ENFORCER.load_rules(True) + + +def _check_rule(context, rule): + init() + # the target is user-self + credentials = context.to_policy_values() + try: + return _ROLE_ENFORCER.authorize(rule, credentials, credentials) + except policy.PolicyNotRegistered: + return False + + +def check_is_admin(context): + """Verify context has admin rights according to the global policy settings. + + :param context: The context object. + :returns: True if the context has admin rights (as per the global + enforcer) and False otherwise. + """ + return _check_rule(context, _ADMIN_CTX_POLICY) + + +def check_is_advsvc(context): + """Verify context has advsvc rights according to global policy settings. + + :param context: The context object. + :returns: True if the context has advsvc rights (as per the global + enforcer) and False otherwise. + """ + return _check_rule(context, _ADVSVC_CTX_POLICY) + + +def list_rules(): + return _BASE_RULES + + +def get_enforcer(): + # NOTE(amotoki): This was borrowed from nova/policy.py. + # This method is for use by oslo.policy CLI scripts. Those scripts need the + # 'output-file' and 'namespace' options, but having those in sys.argv means + # loading the neutron config options will fail as those are not expected to + # be present. So we pass in an arg list with those stripped out. + conf_args = [] + # Start at 1 because cfg.CONF expects the equivalent of sys.argv[1:] + i = 1 + while i < len(sys.argv): + if sys.argv[i].strip('-') in ['namespace', 'output-file']: + i += 2 + continue + conf_args.append(sys.argv[i]) + i += 1 + + # 'project' must be 'neutron' so that get_enforcer looks at + # /etc/neutron/policy.json by default. + cfg.CONF(conf_args, project='neutron') + init() + return _ROLE_ENFORCER diff -Nru python-neutron-lib-1.22.0/neutron_lib/policy/__init__.py python-neutron-lib-1.25.0/neutron_lib/policy/__init__.py --- python-neutron-lib-1.22.0/neutron_lib/policy/__init__.py 1970-01-01 00:00:00.000000000 +0000 +++ python-neutron-lib-1.25.0/neutron_lib/policy/__init__.py 2019-02-28 17:08:45.000000000 +0000 @@ -0,0 +1,29 @@ +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + + +def policy_and(*args): + return ' and '.join(args) + + +def policy_or(*args): + return ' or '.join(args) + + +RULE_ADMIN_OR_OWNER = 'rule:admin_or_owner' +RULE_ADMIN_ONLY = 'rule:admin_only' +RULE_ANY = 'rule:regular_user' +RULE_ADVSVC = 'rule:context_is_advsvc' +RULE_ADMIN_OR_NET_OWNER = 'rule:admin_or_network_owner' +RULE_ADMIN_OR_NET_OWNER_OR_ADVSVC = policy_or(RULE_ADMIN_OR_NET_OWNER, + RULE_ADVSVC) +RULE_ADMIN_OR_PARENT_OWNER = 'rule:admin_or_ext_parent_owner' diff -Nru python-neutron-lib-1.22.0/neutron_lib/_policy.py python-neutron-lib-1.25.0/neutron_lib/_policy.py --- python-neutron-lib-1.22.0/neutron_lib/_policy.py 2019-01-21 20:24:20.000000000 +0000 +++ python-neutron-lib-1.25.0/neutron_lib/_policy.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,110 +0,0 @@ -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -import sys - -from oslo_config import cfg -from oslo_policy import policy - - -_ROLE_ENFORCER = None -_ADMIN_CTX_POLICY = 'context_is_admin' -_ADVSVC_CTX_POLICY = 'context_is_advsvc' - - -_BASE_RULES = [ - policy.RuleDefault( - _ADMIN_CTX_POLICY, - 'role:admin', - description='Rule for cloud admin access'), - policy.RuleDefault( - _ADVSVC_CTX_POLICY, - 'role:advsvc', - description='Rule for advanced service role access'), -] - - -def init(conf=cfg.CONF, policy_file=None): - """Initialize the global enforcer if not already initialized. - - Initialize the global enforcer (and load its rules) if not already - initialized; otherwise this is a no-op. - - :param conf: The configuration to initialize the global enforcer with. - Defaults to oslo_config.cfg.CONF. - :param policy_file: The policy file to initialize the global enforcer - with. - :returns: None. - """ - - global _ROLE_ENFORCER - if not _ROLE_ENFORCER: - _ROLE_ENFORCER = policy.Enforcer(conf, policy_file=policy_file) - _ROLE_ENFORCER.register_defaults(_BASE_RULES) - _ROLE_ENFORCER.load_rules(True) - - -def _check_rule(context, rule): - init() - # the target is user-self - credentials = context.to_policy_values() - try: - return _ROLE_ENFORCER.authorize(rule, credentials, credentials) - except policy.PolicyNotRegistered: - return False - - -def check_is_admin(context): - """Verify context has admin rights according to the global policy settings. - - :param context: The context object. - :returns: True if the context has admin rights (as per the global - enforcer) and False otherwise. - """ - return _check_rule(context, _ADMIN_CTX_POLICY) - - -def check_is_advsvc(context): - """Verify context has advsvc rights according to global policy settings. - - :param context: The context object. - :returns: True if the context has advsvc rights (as per the global - enforcer) and False otherwise. - """ - return _check_rule(context, _ADVSVC_CTX_POLICY) - - -def list_rules(): - return _BASE_RULES - - -def get_enforcer(): - # NOTE(amotoki): This was borrowed from nova/policy.py. - # This method is for use by oslo.policy CLI scripts. Those scripts need the - # 'output-file' and 'namespace' options, but having those in sys.argv means - # loading the neutron config options will fail as those are not expected to - # be present. So we pass in an arg list with those stripped out. - conf_args = [] - # Start at 1 because cfg.CONF expects the equivalent of sys.argv[1:] - i = 1 - while i < len(sys.argv): - if sys.argv[i].strip('-') in ['namespace', 'output-file']: - i += 2 - continue - conf_args.append(sys.argv[i]) - i += 1 - - # 'project' must be 'neutron' so that get_enforcer looks at - # /etc/neutron/policy.json by default. - cfg.CONF(conf_args, project='neutron') - init() - return _ROLE_ENFORCER diff -Nru python-neutron-lib-1.22.0/neutron_lib/rpc.py python-neutron-lib-1.25.0/neutron_lib/rpc.py --- python-neutron-lib-1.22.0/neutron_lib/rpc.py 2019-01-21 20:24:23.000000000 +0000 +++ python-neutron-lib-1.25.0/neutron_lib/rpc.py 2019-02-28 17:08:45.000000000 +0000 @@ -25,6 +25,7 @@ from oslo_config import cfg from oslo_log import log as logging import oslo_messaging +from oslo_messaging import exceptions as oslomsg_exc from oslo_messaging.rpc import dispatcher from oslo_messaging import serializer as om_serializer from oslo_service import service @@ -90,6 +91,10 @@ return collections.defaultdict(_get_default_method_timeout) +def _get_rpc_response_max_timeout(): + return TRANSPORT.conf.rpc_response_max_timeout + + class _ContextWrapper(object): def __init__(self, original_context): self._original_context = original_context @@ -100,12 +105,8 @@ def cast(self, ctxt, method, **kwargs): try: self._original_context.cast(ctxt, method, **kwargs) - except Exception as e: - # TODO(kevinbenton): make catch specific to missing exchange once - # bug/1705351 is resolved on the oslo.messaging side; if - # oslo.messaging auto-creates the exchange, then just remove the - # code completely - LOG.debug("Ignored exception during cast: %e", e) + except oslomsg_exc.MessageDeliveryFailure as e: + LOG.debug("Ignored exception during cast: %s", str(e)) class _BackingOffContextWrapper(_ContextWrapper): @@ -129,7 +130,7 @@ @classmethod def get_max_timeout(cls): - return cls._max_timeout or _get_default_method_timeout() * 10 + return cls._max_timeout or _get_rpc_response_max_timeout() @classmethod def set_max_timeout(cls, max_timeout): diff -Nru python-neutron-lib-1.22.0/neutron_lib/services/constants.py python-neutron-lib-1.25.0/neutron_lib/services/constants.py --- python-neutron-lib-1.22.0/neutron_lib/services/constants.py 1970-01-01 00:00:00.000000000 +0000 +++ python-neutron-lib-1.25.0/neutron_lib/services/constants.py 2019-02-28 17:08:45.000000000 +0000 @@ -0,0 +1,29 @@ +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +from neutron_lib.api.definitions import l3 +from neutron_lib.plugins import constants as plugin_const + + +# Registered extension parent resource check mapping +# If we want to register some service plugin resources into policy and check +# the owner when operating their subresources. We can write here to use +# existing policy engine for parent resource owner check. +# Each entry here should be PARENT_RESOURCE_NAME: SERVICE_PLUGIN_NAME, +# PARENT_RESOURCE_NAME is usually from api definition. +# SERVICE_PLUGIN_NAME is the service plugin which introduced the resource and +# registered the service plugin name in neutron-lib. +EXT_PARENT_RESOURCE_MAPPING = { + l3.FLOATINGIP: plugin_const.L3 +} diff -Nru python-neutron-lib-1.22.0/neutron_lib/services/trunk/constants.py python-neutron-lib-1.25.0/neutron_lib/services/trunk/constants.py --- python-neutron-lib-1.22.0/neutron_lib/services/trunk/constants.py 1970-01-01 00:00:00.000000000 +0000 +++ python-neutron-lib-1.25.0/neutron_lib/services/trunk/constants.py 2019-02-28 17:08:45.000000000 +0000 @@ -0,0 +1,80 @@ +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + + +# Valid trunk statuses + +# The trunk is happy, yay! +# A trunk remains in ACTIVE state when updates like name or admin_status_up +# occur. It goes back to ACTIVE state from other states (e.g. BUILD) when +# logical and physical resource provisioning has completed successfully. The +# attribute ADMIN_STATE_UP is not to be confused with STATUS: the former +# indicates whether a trunk can be managed. If a trunk has admin_state_up +# equal to false, the trunk plugin will reject any user request to manage +# the trunk resources (i.e. adding/removing sub-ports). ACTIVE_STATUS +# reflects the provisioning state of logical and physical resources associated +# with the trunk. +TRUNK_ACTIVE_STATUS = 'ACTIVE' + +# A trunk is in DOWN state any time the logical and physical resources +# associated to a trunk are not in sync. This can happen in the following +# cases: +# a) A user has asked to create a trunk, or add(remove) subports to a +# trunk in ACTIVE state. In this case, the plugin has created/updated the +# logical resource, and the request has been passed along to a backend. The +# physical resources associated to the trunk are in the process of being +# (de)commissioned. While this happens, the logical and physical state are +# mismatching, albeit temporarily during subport operations, or until a user +# spawns a VM after a trunk creation. +# b) A system event, such as instance deletion, has led to the deprovisioning +# of the entire set of physical resources associated to the trunk. In this +# case, the logical resource exists but it has no physical resources +# associated with it, and the logical and physical state of the trunk are +# not matching. +TRUNK_DOWN_STATUS = 'DOWN' + +# A driver/backend has acknowledged the server request: once the server +# notifies the driver/backend, a trunk is in BUILD state while the +# backend provisions the trunk resources. +TRUNK_BUILD_STATUS = 'BUILD' + +# Should any temporary system failure occur during the provisioning process, +# a trunk is in DEGRADED state. This means that the trunk was only +# partially provisioned, and only a subset of the subports were added +# successfully to the trunk. The operation of removing/adding the faulty +# subports may be attempted as a recovery measure. +TRUNK_DEGRADED_STATUS = 'DEGRADED' + +# Due to unforeseen circumstances, the user request has led to a conflict, and +# the trunk cannot be provisioned correctly for a subset of subports. For +# instance, a subport belonging to a network might not be compatible with +# the current trunk configuration, or the binding process leads to a persistent +# failure. Removing the 'offending' resource may be attempted as a recovery +# measure, but readding it to the trunk should lead to the same error +# condition. A trunk in ERROR status should be brought back to a sane status +# (i.e. any state except ERROR state) before attempting to add more subports, +# therefore requests of adding more subports must be rejected to avoid +# cascading errors. +TRUNK_ERROR_STATUS = 'ERROR' + + +# String literals for identifying trunk resources +# also see SUBPORTS, TRUNK and TRUNK_PLUGIN in neutron_lib.callbacks.resources +TRUNK_PARENT_PORT = 'parent_port' +TRUNK_SUBPORT_OWNER = 'trunk:subport' + + +# String literals for segmentation types +SEGMENTATION_TYPE_VLAN = 'vlan' +SEGMENTATION_TYPE_INHERIT = 'inherit' diff -Nru python-neutron-lib-1.22.0/neutron_lib/tests/_base.py python-neutron-lib-1.25.0/neutron_lib/tests/_base.py --- python-neutron-lib-1.22.0/neutron_lib/tests/_base.py 2019-01-21 20:24:20.000000000 +0000 +++ python-neutron-lib-1.25.0/neutron_lib/tests/_base.py 2019-02-28 17:08:45.000000000 +0000 @@ -32,7 +32,7 @@ from neutron_lib import fixture from neutron_lib.tests import _post_mortem_debug as post_mortem_debug -from neutron_lib.tests import _tools as tools +from neutron_lib.tests import tools CONF = cfg.CONF diff -Nru python-neutron-lib-1.22.0/neutron_lib/tests/_tools.py python-neutron-lib-1.25.0/neutron_lib/tests/_tools.py --- python-neutron-lib-1.22.0/neutron_lib/tests/_tools.py 2019-01-21 20:24:20.000000000 +0000 +++ python-neutron-lib-1.25.0/neutron_lib/tests/_tools.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,59 +0,0 @@ -# Copyright (c) 2013 NEC Corporation -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -import platform -import warnings - -import fixtures - -from neutron_lib.utils import helpers - - -class UnorderedList(list): - """A list that is equals to any permutation of itself.""" - - def __eq__(self, other): - if not isinstance(other, list): - return False - return (sorted(self, key=helpers.safe_sort_key) == - sorted(other, key=helpers.safe_sort_key)) - - def __neq__(self, other): - return not self == other - - -class WarningsFixture(fixtures.Fixture): - """Filters out warnings during test runs.""" - - warning_types = ( - DeprecationWarning, PendingDeprecationWarning, ImportWarning - ) - - def _setUp(self): - self.addCleanup(warnings.resetwarnings) - for wtype in self.warning_types: - warnings.filterwarnings( - "always", category=wtype, module='^neutron_lib\\.') - - -def is_bsd(): - """Return True on BSD-based systems.""" - - system = platform.system() - if system == 'Darwin': - return True - if 'bsd' in system.lower(): - return True - return False diff -Nru python-neutron-lib-1.22.0/neutron_lib/tests/tools.py python-neutron-lib-1.25.0/neutron_lib/tests/tools.py --- python-neutron-lib-1.22.0/neutron_lib/tests/tools.py 1970-01-01 00:00:00.000000000 +0000 +++ python-neutron-lib-1.25.0/neutron_lib/tests/tools.py 2019-02-28 17:08:45.000000000 +0000 @@ -0,0 +1,68 @@ +# Copyright (c) 2013 NEC Corporation +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +import platform +import random +import warnings + +import fixtures + +from neutron_lib.utils import helpers + + +class UnorderedList(list): + """A list that is equals to any permutation of itself.""" + + def __eq__(self, other): + if not isinstance(other, list): + return False + return (sorted(self, key=helpers.safe_sort_key) == + sorted(other, key=helpers.safe_sort_key)) + + def __neq__(self, other): + return not self == other + + +class WarningsFixture(fixtures.Fixture): + """Filters out warnings during test runs.""" + + warning_types = ( + DeprecationWarning, PendingDeprecationWarning, ImportWarning + ) + + def _setUp(self): + self.addCleanup(warnings.resetwarnings) + for wtype in self.warning_types: + warnings.filterwarnings( + "always", category=wtype, module='^neutron_lib\\.') + + +def is_bsd(): + """Return True on BSD-based systems.""" + + system = platform.system() + if system == 'Darwin': + return True + if 'bsd' in system.lower(): + return True + return False + + +def get_random_cidr(version=4): + if version == 4: + return '10.%d.%d.0/%d' % (random.randint(3, 254), + random.randint(3, 254), + 24) + return '2001:db8:%x::/%d' % (random.getrandbits(16), 64) diff -Nru python-neutron-lib-1.22.0/neutron_lib/tests/unit/api/definitions/base.py python-neutron-lib-1.25.0/neutron_lib/tests/unit/api/definitions/base.py --- python-neutron-lib-1.22.0/neutron_lib/tests/unit/api/definitions/base.py 2019-01-21 20:24:20.000000000 +0000 +++ python-neutron-lib-1.25.0/neutron_lib/tests/unit/api/definitions/base.py 2019-02-28 17:08:45.000000000 +0000 @@ -110,9 +110,9 @@ def test_resource_map(self): if (not self.resource_map and not self.subresource_map and - not self.is_shim_extension): - self.fail('Missing resource and subresource map, ' - 'what is this extension doing?') + not self.is_shim_extension and not self.action_map): + self.fail('Missing resource map, subresource map, ' + 'and action map, what is this extension doing?') elif self.is_shim_extension: self.skipTest('Shim extension with no API changes.') diff -Nru python-neutron-lib-1.22.0/neutron_lib/tests/unit/api/definitions/test_agent_resources_synced.py python-neutron-lib-1.25.0/neutron_lib/tests/unit/api/definitions/test_agent_resources_synced.py --- python-neutron-lib-1.22.0/neutron_lib/tests/unit/api/definitions/test_agent_resources_synced.py 1970-01-01 00:00:00.000000000 +0000 +++ python-neutron-lib-1.25.0/neutron_lib/tests/unit/api/definitions/test_agent_resources_synced.py 2019-02-28 17:08:45.000000000 +0000 @@ -0,0 +1,21 @@ +# Copyright (c) 2018 Ericsson +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +from neutron_lib.api.definitions import agent_resources_synced +from neutron_lib.tests.unit.api.definitions import test_agent as base + + +class AgentResourcesSyncedDefinitionTestCase(base.AgentDefinitionTestCase): + extension_module = agent_resources_synced + extension_attributes = (agent_resources_synced.RESOURCES_SYNCED,) diff -Nru python-neutron-lib-1.22.0/neutron_lib/tests/unit/api/definitions/test_floatingip_autodelete_internal.py python-neutron-lib-1.25.0/neutron_lib/tests/unit/api/definitions/test_floatingip_autodelete_internal.py --- python-neutron-lib-1.22.0/neutron_lib/tests/unit/api/definitions/test_floatingip_autodelete_internal.py 1970-01-01 00:00:00.000000000 +0000 +++ python-neutron-lib-1.25.0/neutron_lib/tests/unit/api/definitions/test_floatingip_autodelete_internal.py 2019-02-28 17:08:45.000000000 +0000 @@ -0,0 +1,20 @@ +# Copyright 2019 Ericsson +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +from neutron_lib.api.definitions import floatingip_autodelete_internal +from neutron_lib.tests.unit.api.definitions import base + + +class FloatingIPAutodeleteInternalTestCase(base.DefinitionBaseTestCase): + extension_module = floatingip_autodelete_internal diff -Nru python-neutron-lib-1.22.0/neutron_lib/tests/unit/api/definitions/test_interconnection.py python-neutron-lib-1.25.0/neutron_lib/tests/unit/api/definitions/test_interconnection.py --- python-neutron-lib-1.22.0/neutron_lib/tests/unit/api/definitions/test_interconnection.py 1970-01-01 00:00:00.000000000 +0000 +++ python-neutron-lib-1.25.0/neutron_lib/tests/unit/api/definitions/test_interconnection.py 2019-02-28 17:08:45.000000000 +0000 @@ -0,0 +1,24 @@ +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +from neutron_lib.api.definitions import interconnection +from neutron_lib.tests.unit.api.definitions import base + + +class InterconnectionDefinitionTestCase(base.DefinitionBaseTestCase): + extension_module = interconnection + extension_resources = (interconnection.COLLECTION_NAME,) + extension_attributes = ('type', 'state', + 'local_resource_id', 'remote_resource_id', + 'remote_keystone', 'remote_region', + 'remote_interconnection_id', 'local_parameters', + 'remote_parameters') diff -Nru python-neutron-lib-1.22.0/neutron_lib/tests/unit/api/definitions/test_rbac_security_groups.py python-neutron-lib-1.25.0/neutron_lib/tests/unit/api/definitions/test_rbac_security_groups.py --- python-neutron-lib-1.22.0/neutron_lib/tests/unit/api/definitions/test_rbac_security_groups.py 1970-01-01 00:00:00.000000000 +0000 +++ python-neutron-lib-1.25.0/neutron_lib/tests/unit/api/definitions/test_rbac_security_groups.py 2019-02-28 17:08:45.000000000 +0000 @@ -0,0 +1,18 @@ +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +from neutron_lib.api.definitions import rbac_security_groups +from neutron_lib.tests.unit.api.definitions import base + + +class RbacSecurityGroupsDefinitionTestCase(base.DefinitionBaseTestCase): + extension_module = rbac_security_groups diff -Nru python-neutron-lib-1.22.0/neutron_lib/tests/unit/api/definitions/test_subnetpool_prefix_ops.py python-neutron-lib-1.25.0/neutron_lib/tests/unit/api/definitions/test_subnetpool_prefix_ops.py --- python-neutron-lib-1.22.0/neutron_lib/tests/unit/api/definitions/test_subnetpool_prefix_ops.py 1970-01-01 00:00:00.000000000 +0000 +++ python-neutron-lib-1.25.0/neutron_lib/tests/unit/api/definitions/test_subnetpool_prefix_ops.py 2019-02-28 17:08:45.000000000 +0000 @@ -0,0 +1,19 @@ +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +from neutron_lib.api.definitions import subnetpool_prefix_ops +from neutron_lib.tests.unit.api.definitions import base + + +class SubnetPoolPrefixOpsDefinitionTestCase(base.DefinitionBaseTestCase): + extension_module = subnetpool_prefix_ops + extension_attributes = () diff -Nru python-neutron-lib-1.22.0/neutron_lib/tests/unit/api/test_conversions.py python-neutron-lib-1.25.0/neutron_lib/tests/unit/api/test_conversions.py --- python-neutron-lib-1.22.0/neutron_lib/tests/unit/api/test_conversions.py 2019-01-21 20:24:20.000000000 +0000 +++ python-neutron-lib-1.25.0/neutron_lib/tests/unit/api/test_conversions.py 2019-02-28 17:08:45.000000000 +0000 @@ -22,7 +22,7 @@ from neutron_lib import constants from neutron_lib import exceptions as n_exc from neutron_lib.tests import _base as base -from neutron_lib.tests import _tools as tools +from neutron_lib.tests import tools class TestConvertToBoolean(base.BaseTestCase): diff -Nru python-neutron-lib-1.22.0/neutron_lib/tests/unit/api/validators/test_validators.py python-neutron-lib-1.25.0/neutron_lib/tests/unit/api/validators/test_validators.py --- python-neutron-lib-1.22.0/neutron_lib/tests/unit/api/validators/test_validators.py 2019-01-21 20:24:20.000000000 +0000 +++ python-neutron-lib-1.25.0/neutron_lib/tests/unit/api/validators/test_validators.py 2019-02-28 17:08:45.000000000 +0000 @@ -149,7 +149,7 @@ # Check that value is not comparable to valid_values and got Exception data = 1 valid_values = '[2, 3, 4, 5]' - response = "'data' of type '%s' and 'valid_values'of type" \ + response = "'data' of type '%s' and 'valid_values' of type" \ " '%s' are not compatible for comparison" % ( type(data), type(valid_values)) self.assertRaisesRegex(TypeError, response, diff -Nru python-neutron-lib-1.22.0/neutron_lib/tests/unit/db/test_api.py python-neutron-lib-1.25.0/neutron_lib/tests/unit/db/test_api.py --- python-neutron-lib-1.22.0/neutron_lib/tests/unit/db/test_api.py 2019-01-21 20:24:20.000000000 +0000 +++ python-neutron-lib-1.25.0/neutron_lib/tests/unit/db/test_api.py 2019-02-28 17:08:45.000000000 +0000 @@ -158,7 +158,7 @@ if exc_to_raise == db_exc.DBDeadlock: self.assertEqual(True, (fake_timer.counter <= sum(worst_case))) else: - self.assertEqual(sum(worst_case), fake_timer.counter) + self.assertTrue(sum(worst_case) >= fake_timer.counter) def test_all_deadlock_time_elapsed(self): self._test_retry_time_cost(db_exc.DBDeadlock) @@ -213,7 +213,5 @@ osprofiler.sqlalchemy, 'add_tracing') as add_tracing: engine_mock = mock.Mock() db_api._set_hook(engine_mock) - self.assertEqual(2, len(add_tracing.mock_calls)) - expected_calls = [mock.call(sqlalchemy, mock.ANY, n) - for n in db_api.OSPROFILER_TRACE_NAMES] - self.assertEqual(expected_calls, add_tracing.mock_calls) + add_tracing.assert_called_once_with( + sqlalchemy, mock.ANY, "neutron.db") diff -Nru python-neutron-lib-1.22.0/neutron_lib/tests/unit/db/test_sqlalchemytypes.py python-neutron-lib-1.25.0/neutron_lib/tests/unit/db/test_sqlalchemytypes.py --- python-neutron-lib-1.22.0/neutron_lib/tests/unit/db/test_sqlalchemytypes.py 1970-01-01 00:00:00.000000000 +0000 +++ python-neutron-lib-1.25.0/neutron_lib/tests/unit/db/test_sqlalchemytypes.py 2019-02-28 17:08:45.000000000 +0000 @@ -0,0 +1,260 @@ +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +import abc + +import netaddr +from oslo_db import exception +from oslo_db.sqlalchemy import enginefacade +from oslo_db.sqlalchemy import test_fixtures +from oslo_utils import timeutils +from oslo_utils import uuidutils +import six +import sqlalchemy as sa + +from neutron_lib import context +from neutron_lib.db import sqlalchemytypes +from neutron_lib.tests import _base as test_base +from neutron_lib.tests import tools +from neutron_lib.utils import net + + +@six.add_metaclass(abc.ABCMeta) +class SqlAlchemyTypesBaseTestCase(test_fixtures.OpportunisticDBTestMixin, + test_base.BaseTestCase): + def setUp(self): + super(SqlAlchemyTypesBaseTestCase, self).setUp() + self.engine = enginefacade.writer.get_engine() + meta = sa.MetaData(bind=self.engine) + self.test_table = self._get_test_table(meta) + self.test_table.create() + self.addCleanup(meta.drop_all) + self.ctxt = context.get_admin_context() + + @abc.abstractmethod + def _get_test_table(self, meta): + """Returns a new sa.Table() object for this test case.""" + + def _add_row(self, **kargs): + self.engine.execute(self.test_table.insert().values(**kargs)) + + def _get_all(self): + rows_select = self.test_table.select() + return self.engine.execute(rows_select).fetchall() + + def _update_row(self, **kargs): + self.engine.execute(self.test_table.update().values(**kargs)) + + def _delete_rows(self): + self.engine.execute(self.test_table.delete()) + + def _validate_crud(self, data_field_name, expected=None): + objs = self._get_all() + self.assertEqual(len(expected) if expected else 0, len(objs)) + if expected: + for obj in objs: + name = obj['id'] + self.assertEqual(expected[name], obj[data_field_name]) + + +class IPAddressTestCase(SqlAlchemyTypesBaseTestCase): + + def _get_test_table(self, meta): + return sa.Table( + 'fakeipaddressmodels', + meta, + sa.Column('id', sa.String(36), primary_key=True, nullable=False), + sa.Column('ip', sqlalchemytypes.IPAddress)) + + def _validate_ip_address(self, data_field_name, expected=None): + objs = self._get_all() + self.assertEqual(len(expected) if expected else 0, len(objs)) + if expected: + for obj in objs: + name = obj['id'] + self.assertEqual(expected[name], obj[data_field_name]) + + def _test_crud(self, ip_addresses): + ip = netaddr.IPAddress(ip_addresses[0]) + self._add_row(id='fake_id', ip=ip) + self._validate_ip_address(data_field_name='ip', + expected={'fake_id': ip}) + + ip2 = netaddr.IPAddress(ip_addresses[1]) + self._update_row(ip=ip2) + self._validate_ip_address(data_field_name='ip', + expected={'fake_id': ip2}) + + self._delete_rows() + self._validate_ip_address(data_field_name='ip', expected=None) + + def test_crud(self): + ip_addresses = ["10.0.0.1", "10.0.0.2"] + self._test_crud(ip_addresses) + + ip_addresses = ["2210::ffff:ffff:ffff:ffff", + "2120::ffff:ffff:ffff:ffff"] + self._test_crud(ip_addresses) + + def test_wrong_type(self): + self.assertRaises(exception.DBError, self._add_row, + id='fake_id', ip="") + self.assertRaises(exception.DBError, self._add_row, + id='fake_id', ip="10.0.0.5") + + def _test_multiple_create(self, entries): + reference = {} + for entry in entries: + ip = netaddr.IPAddress(entry['ip']) + name = entry['name'] + self._add_row(id=name, ip=ip) + reference[name] = ip + + self._validate_ip_address(data_field_name='ip', expected=reference) + self._delete_rows() + self._validate_ip_address(data_field_name='ip', expected=None) + + def test_multiple_create(self): + ip_addresses = [ + {'name': 'fake_id1', 'ip': "10.0.0.5"}, + {'name': 'fake_id2', 'ip': "10.0.0.1"}, + {'name': 'fake_id3', + 'ip': "2210::ffff:ffff:ffff:ffff"}, + {'name': 'fake_id4', + 'ip': "2120::ffff:ffff:ffff:ffff"}] + self._test_multiple_create(ip_addresses) + + +class CIDRTestCase(SqlAlchemyTypesBaseTestCase): + + def _get_test_table(self, meta): + return sa.Table( + 'fakecidrmodels', + meta, + sa.Column('id', sa.String(36), primary_key=True, nullable=False), + sa.Column('cidr', sqlalchemytypes.CIDR) + ) + + def _get_one(self, value): + row_select = self.test_table.select().\ + where(self.test_table.c.cidr == value) + return self.engine.execute(row_select).first() + + def _update_row(self, key, cidr): + self.engine.execute( + self.test_table.update().values(cidr=cidr). + where(self.test_table.c.cidr == key)) + + def test_crud(self): + cidrs = ["10.0.0.0/24", "10.123.250.9/32", "2001:db8::/42", + "fe80::21e:67ff:fed0:56f0/64"] + + for cidr_str in cidrs: + cidr = netaddr.IPNetwork(cidr_str) + self._add_row(id=uuidutils.generate_uuid(), cidr=cidr) + obj = self._get_one(cidr) + self.assertEqual(cidr, obj['cidr']) + random_cidr = netaddr.IPNetwork(tools.get_random_cidr()) + self._update_row(cidr, random_cidr) + obj = self._get_one(random_cidr) + self.assertEqual(random_cidr, obj['cidr']) + + objs = self._get_all() + self.assertEqual(len(cidrs), len(objs)) + self._delete_rows() + objs = self._get_all() + self.assertEqual(0, len(objs)) + + def test_wrong_cidr(self): + wrong_cidrs = ["10.500.5.0/24", "10.0.0.1/40", "10.0.0.10.0/24", + "cidr", "", '2001:db8:5000::/64', '2001:db8::/130'] + for cidr in wrong_cidrs: + self.assertRaises(exception.DBError, self._add_row, + id=uuidutils.generate_uuid(), cidr=cidr) + + +class MACAddressTestCase(SqlAlchemyTypesBaseTestCase): + + def _get_test_table(self, meta): + return sa.Table( + 'fakemacaddressmodels', + meta, + sa.Column('id', sa.String(36), primary_key=True, nullable=False), + sa.Column('mac', sqlalchemytypes.MACAddress) + ) + + def _get_one(self, value): + row_select = self.test_table.select().\ + where(self.test_table.c.mac == value) + return self.engine.execute(row_select).first() + + def _get_all(self): + rows_select = self.test_table.select() + return self.engine.execute(rows_select).fetchall() + + def _update_row(self, key, mac): + self.engine.execute( + self.test_table.update().values(mac=mac). + where(self.test_table.c.mac == key)) + + def _delete_row(self): + self.engine.execute( + self.test_table.delete()) + + def test_crud(self): + mac_addresses = ['FA:16:3E:00:00:01', 'FA:16:3E:00:00:02'] + + for mac in mac_addresses: + mac = netaddr.EUI(mac) + self._add_row(id=uuidutils.generate_uuid(), mac=mac) + obj = self._get_one(mac) + self.assertEqual(mac, obj['mac']) + random_mac = netaddr.EUI(net.get_random_mac( + ['fe', '16', '3e', '00', '00', '00'])) + self._update_row(mac, random_mac) + obj = self._get_one(random_mac) + self.assertEqual(random_mac, obj['mac']) + + objs = self._get_all() + self.assertEqual(len(mac_addresses), len(objs)) + self._delete_rows() + objs = self._get_all() + self.assertEqual(0, len(objs)) + + def test_wrong_mac(self): + wrong_macs = ["fake", "", -1, + "FK:16:3E:00:00:02", + "FA:16:3E:00:00:020"] + for mac in wrong_macs: + self.assertRaises(exception.DBError, self._add_row, + id=uuidutils.generate_uuid(), mac=mac) + + +class TruncatedDateTimeTestCase(SqlAlchemyTypesBaseTestCase): + + def _get_test_table(self, meta): + return sa.Table( + 'timetable', + meta, + sa.Column('id', sa.String(36), primary_key=True, nullable=False), + sa.Column('thetime', sqlalchemytypes.TruncatedDateTime) + ) + + def test_microseconds_truncated(self): + tstamp = timeutils.utcnow() + tstamp_low = tstamp.replace(microsecond=111111) + tstamp_high = tstamp.replace(microsecond=999999) + self._add_row(id=1, thetime=tstamp_low) + self._add_row(id=2, thetime=tstamp_high) + rows = self._get_all() + self.assertEqual(2, len(rows)) + self.assertEqual(rows[0].thetime, rows[1].thetime) diff -Nru python-neutron-lib-1.22.0/neutron_lib/tests/unit/plugins/test_utils.py python-neutron-lib-1.25.0/neutron_lib/tests/unit/plugins/test_utils.py --- python-neutron-lib-1.22.0/neutron_lib/tests/unit/plugins/test_utils.py 2019-01-21 20:24:20.000000000 +0000 +++ python-neutron-lib-1.25.0/neutron_lib/tests/unit/plugins/test_utils.py 2019-02-28 17:08:45.000000000 +0000 @@ -253,22 +253,22 @@ def test_get_port_binding_by_status_and_host(self): bindings = [] self.assertIsNone(utils.get_port_binding_by_status_and_host( - bindings, constants.INACTIVE)) + bindings, constants.INACTIVE)) bindings.extend([{pb_ext.STATUS: constants.INACTIVE, pb_ext.HOST: 'host-1'}, {pb_ext.STATUS: constants.INACTIVE, pb_ext.HOST: 'host-2'}]) self.assertEqual( 'host-1', utils.get_port_binding_by_status_and_host( - bindings, - constants.INACTIVE)[pb_ext.HOST]) + bindings, + constants.INACTIVE)[pb_ext.HOST]) self.assertEqual( 'host-2', utils.get_port_binding_by_status_and_host( - bindings, - constants.INACTIVE, - host='host-2')[pb_ext.HOST]) + bindings, + constants.INACTIVE, + host='host-2')[pb_ext.HOST]) self.assertIsNone(utils.get_port_binding_by_status_and_host( - bindings, constants.ACTIVE)) + bindings, constants.ACTIVE)) self.assertRaises(exceptions.PortBindingNotFound, utils.get_port_binding_by_status_and_host, bindings, constants.ACTIVE, 'host', True, 'port_id') diff -Nru python-neutron-lib-1.22.0/neutron_lib/tests/unit/policy/test__engine.py python-neutron-lib-1.25.0/neutron_lib/tests/unit/policy/test__engine.py --- python-neutron-lib-1.22.0/neutron_lib/tests/unit/policy/test__engine.py 1970-01-01 00:00:00.000000000 +0000 +++ python-neutron-lib-1.25.0/neutron_lib/tests/unit/policy/test__engine.py 2019-02-28 17:08:45.000000000 +0000 @@ -0,0 +1,74 @@ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import mock + +from neutron_lib import context +from neutron_lib.policy import _engine as policy_engine + +from neutron_lib.tests import _base as base + + +class TestPolicyEnforcer(base.BaseTestCase): + def setUp(self): + super(TestPolicyEnforcer, self).setUp() + # Isolate one _ROLE_ENFORCER per test case + mock.patch.object(policy_engine, '_ROLE_ENFORCER', None).start() + + def test_init_reset(self): + self.assertIsNone(policy_engine._ROLE_ENFORCER) + policy_engine.init() + self.assertIsNotNone(policy_engine._ROLE_ENFORCER) + + def test_check_user_is_not_admin(self): + ctx = context.Context('me', 'my_project') + self.assertFalse(policy_engine.check_is_admin(ctx)) + + def test_check_user_elevated_is_admin(self): + ctx = context.Context('me', 'my_project', roles=['user']).elevated() + self.assertTrue(policy_engine.check_is_admin(ctx)) + + def test_check_is_admin_no_roles_no_admin(self): + policy_engine.init(policy_file='dummy_policy.json') + ctx = context.Context('me', 'my_project', roles=['user']).elevated() + # With no admin role, elevated() should not work. + self.assertFalse(policy_engine.check_is_admin(ctx)) + + def test_check_user_elevated_is_admin_with_default_policy(self): + policy_engine.init(policy_file='no_policy.json') + ctx = context.Context('me', 'my_project', roles=['user']).elevated() + self.assertTrue(policy_engine.check_is_admin(ctx)) + + def test_check_is_advsvc_role(self): + ctx = context.Context('me', 'my_project', roles=['advsvc']) + self.assertTrue(policy_engine.check_is_advsvc(ctx)) + + def test_check_is_not_advsvc_user(self): + ctx = context.Context('me', 'my_project', roles=['user']) + self.assertFalse(policy_engine.check_is_advsvc(ctx)) + + def test_check_is_not_advsvc_admin(self): + ctx = context.Context('me', 'my_project').elevated() + self.assertTrue(policy_engine.check_is_admin(ctx)) + self.assertFalse(policy_engine.check_is_advsvc(ctx)) + + def test_check_is_advsvc_no_roles_no_advsvc(self): + policy_engine.init(policy_file='dummy_policy.json') + ctx = context.Context('me', 'my_project', roles=['advsvc']) + # No advsvc role in the policy file, so cannot assume the role. + self.assertFalse(policy_engine.check_is_advsvc(ctx)) + + def test_check_is_advsvc_role_with_default_policy(self): + policy_engine.init(policy_file='no_policy.json') + ctx = context.Context('me', 'my_project', roles=['advsvc']) + self.assertTrue(policy_engine.check_is_advsvc(ctx)) diff -Nru python-neutron-lib-1.22.0/neutron_lib/tests/unit/test__policy.py python-neutron-lib-1.25.0/neutron_lib/tests/unit/test__policy.py --- python-neutron-lib-1.22.0/neutron_lib/tests/unit/test__policy.py 2019-01-21 20:24:20.000000000 +0000 +++ python-neutron-lib-1.25.0/neutron_lib/tests/unit/test__policy.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,74 +0,0 @@ -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or -# implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import mock - -from neutron_lib import _policy as policy -from neutron_lib import context - -from neutron_lib.tests import _base as base - - -class TestPolicyEnforcer(base.BaseTestCase): - def setUp(self): - super(TestPolicyEnforcer, self).setUp() - # Isolate one _ROLE_ENFORCER per test case - mock.patch.object(policy, '_ROLE_ENFORCER', None).start() - - def test_init_reset(self): - self.assertIsNone(policy._ROLE_ENFORCER) - policy.init() - self.assertIsNotNone(policy._ROLE_ENFORCER) - - def test_check_user_is_not_admin(self): - ctx = context.Context('me', 'my_project') - self.assertFalse(policy.check_is_admin(ctx)) - - def test_check_user_elevated_is_admin(self): - ctx = context.Context('me', 'my_project', roles=['user']).elevated() - self.assertTrue(policy.check_is_admin(ctx)) - - def test_check_is_admin_no_roles_no_admin(self): - policy.init(policy_file='dummy_policy.json') - ctx = context.Context('me', 'my_project', roles=['user']).elevated() - # With no admin role, elevated() should not work. - self.assertFalse(policy.check_is_admin(ctx)) - - def test_check_user_elevated_is_admin_with_default_policy(self): - policy.init(policy_file='no_policy.json') - ctx = context.Context('me', 'my_project', roles=['user']).elevated() - self.assertTrue(policy.check_is_admin(ctx)) - - def test_check_is_advsvc_role(self): - ctx = context.Context('me', 'my_project', roles=['advsvc']) - self.assertTrue(policy.check_is_advsvc(ctx)) - - def test_check_is_not_advsvc_user(self): - ctx = context.Context('me', 'my_project', roles=['user']) - self.assertFalse(policy.check_is_advsvc(ctx)) - - def test_check_is_not_advsvc_admin(self): - ctx = context.Context('me', 'my_project').elevated() - self.assertTrue(policy.check_is_admin(ctx)) - self.assertFalse(policy.check_is_advsvc(ctx)) - - def test_check_is_advsvc_no_roles_no_advsvc(self): - policy.init(policy_file='dummy_policy.json') - ctx = context.Context('me', 'my_project', roles=['advsvc']) - # No advsvc role in the policy file, so cannot assume the role. - self.assertFalse(policy.check_is_advsvc(ctx)) - - def test_check_is_advsvc_role_with_default_policy(self): - policy.init(policy_file='no_policy.json') - ctx = context.Context('me', 'my_project', roles=['advsvc']) - self.assertTrue(policy.check_is_advsvc(ctx)) diff -Nru python-neutron-lib-1.22.0/neutron_lib/tests/unit/test_rpc.py python-neutron-lib-1.25.0/neutron_lib/tests/unit/test_rpc.py --- python-neutron-lib-1.22.0/neutron_lib/tests/unit/test_rpc.py 2019-01-21 20:24:23.000000000 +0000 +++ python-neutron-lib-1.25.0/neutron_lib/tests/unit/test_rpc.py 2019-02-28 17:08:45.000000000 +0000 @@ -15,6 +15,7 @@ from oslo_config import cfg import oslo_messaging as messaging from oslo_messaging import conffixture as messaging_conffixture +from oslo_messaging import exceptions as oslomsg_exc from oslo_messaging.rpc import dispatcher import testtools @@ -292,6 +293,7 @@ self.call_context = mock.Mock() self.sleep = mock.patch('time.sleep').start() rpc.TRANSPORT.conf.rpc_response_timeout = 10 + rpc.TRANSPORT.conf.rpc_response_max_timeout = 300 def test_timeout_unaffected_when_explicitly_set(self): rpc.TRANSPORT.conf.rpc_response_timeout = 5 @@ -343,19 +345,19 @@ for call in rpc.TRANSPORT._send.call_args_list] self.assertEqual([1, 2, 4, 8, 16], timeouts) - def test_method_timeout_10x_config_ceiling(self): + def test_method_timeout_config_ceiling(self): rpc.TRANSPORT.conf.rpc_response_timeout = 10 # 5 doublings should max out at the 10xdefault ceiling for i in range(5): with testtools.ExpectedException(messaging.MessagingTimeout): self.client.call(self.call_context, 'method_1') self.assertEqual( - 10 * rpc.TRANSPORT.conf.rpc_response_timeout, + rpc.TRANSPORT.conf.rpc_response_max_timeout, rpc._BackingOffContextWrapper._METHOD_TIMEOUTS['method_1']) with testtools.ExpectedException(messaging.MessagingTimeout): self.client.call(self.call_context, 'method_1') self.assertEqual( - 10 * rpc.TRANSPORT.conf.rpc_response_timeout, + rpc.TRANSPORT.conf.rpc_response_max_timeout, rpc._BackingOffContextWrapper._METHOD_TIMEOUTS['method_1']) def test_timeout_unchanged_on_other_exception(self): @@ -426,7 +428,8 @@ def test_set_max_timeout_overrides_default_timeout(self): rpc.TRANSPORT.conf.rpc_response_timeout = 10 self.assertEqual( - 10 * 10, rpc._BackingOffContextWrapper.get_max_timeout()) + rpc.TRANSPORT.conf.rpc_response_max_timeout, + rpc._BackingOffContextWrapper.get_max_timeout()) rpc._BackingOffContextWrapper.set_max_timeout(10) self.assertEqual(10, rpc._BackingOffContextWrapper.get_max_timeout()) @@ -443,7 +446,7 @@ self.addCleanup(rpc.cleanup) rpc.init(CONF) rpc.TRANSPORT = mock.MagicMock() - rpc.TRANSPORT._send.side_effect = Exception + rpc.TRANSPORT._send.side_effect = oslomsg_exc.MessageDeliveryFailure target = messaging.Target(version='1.0', topic='testing') self.client = rpc.get_client(target) self.cast_context = mock.Mock() diff -Nru python-neutron-lib-1.22.0/neutron_lib/tests/unit/test_worker.py python-neutron-lib-1.25.0/neutron_lib/tests/unit/test_worker.py --- python-neutron-lib-1.22.0/neutron_lib/tests/unit/test_worker.py 2019-01-21 20:24:20.000000000 +0000 +++ python-neutron-lib-1.25.0/neutron_lib/tests/unit/test_worker.py 2019-02-28 17:08:45.000000000 +0000 @@ -12,6 +12,8 @@ # License for the specific language governing permissions and limitations # under the License. +import six + import mock from neutron_lib.callbacks import events @@ -34,6 +36,14 @@ pass +# Same as _BaseWorker, but looks like a process launch instead of eventlet +class _ProcWorker(_BaseWorker): + + def __init__(self, worker_process_count=1, set_proctitle='on'): + super(_ProcWorker, self).__init__(worker_process_count, set_proctitle) + self._my_pid = -1 # make it appear to be a separate process + + class TestBaseWorker(base.BaseTestCase): def setUp(self): @@ -51,3 +61,77 @@ base_worker.start() self._reg.notify.assert_called_once_with( resources.PROCESS, events.AFTER_INIT, base_worker.start) + + # Forked workers, should call setproctitle + + def test_proctitle_default(self): + with mock.patch('setproctitle.setproctitle') as spt: + _ProcWorker().start() + six.assertRegex(self, spt.call_args[0][0], + '^neutron-server: _ProcWorker \(.*python.*\)$') + + def test_proctitle_custom_desc(self): + with mock.patch('setproctitle.setproctitle') as spt: + _ProcWorker().start(desc="fancy title") + six.assertRegex(self, spt.call_args[0][0], + '^neutron-server: fancy title \(.*python.*\)$') + + def test_proctitle_custom_name(self): + with mock.patch('setproctitle.setproctitle') as spt: + _ProcWorker().start(name="tardis") + six.assertRegex(self, spt.call_args[0][0], + '^tardis: _ProcWorker \(.*python.*\)$') + + def test_proctitle_empty(self): + with mock.patch('setproctitle.setproctitle') as spt: + _ProcWorker().start(desc="") + six.assertRegex(self, spt.call_args[0][0], + '^neutron-server: _ProcWorker \(.*python.*\)$') + + def test_proctitle_nonstring(self): + with mock.patch('setproctitle.setproctitle') as spt: + _ProcWorker().start(desc=2) + six.assertRegex(self, spt.call_args[0][0], + '^neutron-server: 2 \(.*python.*\)$') + + def test_proctitle_both_empty(self): + with mock.patch('setproctitle.setproctitle') as spt: + _ProcWorker().start(name="", desc="") + six.assertRegex(self, spt.call_args[0][0], + '^: _ProcWorker \(.*python.*\)$') + + def test_proctitle_name_none(self): + with mock.patch('setproctitle.setproctitle') as spt: + _ProcWorker().start(name=None) + six.assertRegex(self, spt.call_args[0][0], + '^None: _ProcWorker \(.*python.*\)$') + + # Forked, but proctitle disabled + + def test_proctitle_off(self): + with mock.patch('setproctitle.setproctitle') as spt: + _ProcWorker(set_proctitle='off').start() + self.assertIsNone(spt.call_args) + + # Eventlet style worker, should never call setproctitle + + def test_proctitle_same_process(self): + with mock.patch('setproctitle.setproctitle') as spt: + _BaseWorker().start() + self.assertIsNone(spt.call_args) + + def test_setproctitle_on(self): + with mock.patch('setproctitle.setproctitle') as spt: + _ProcWorker(set_proctitle='on').start(name="foo", desc="bar") + six.assertRegex(self, spt.call_args[0][0], + '^foo: bar \(.*python.*\)$') + + def test_setproctitle_off(self): + with mock.patch('setproctitle.setproctitle') as spt: + _ProcWorker(set_proctitle='off').start(name="foo", desc="bar") + self.assertIsNone(spt.call_args) + + def test_setproctitle_brief(self): + with mock.patch('setproctitle.setproctitle') as spt: + _ProcWorker(set_proctitle='brief').start(name="foo", desc="bar") + self.assertEqual(spt.call_args[0][0], 'foo: bar') diff -Nru python-neutron-lib-1.22.0/neutron_lib/utils/upgrade_checks.py python-neutron-lib-1.25.0/neutron_lib/utils/upgrade_checks.py --- python-neutron-lib-1.22.0/neutron_lib/utils/upgrade_checks.py 1970-01-01 00:00:00.000000000 +0000 +++ python-neutron-lib-1.25.0/neutron_lib/utils/upgrade_checks.py 2019-02-28 17:08:45.000000000 +0000 @@ -0,0 +1,36 @@ +# Copyright 2018 Red Hat Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +import abc + +import six + + +@six.add_metaclass(abc.ABCMeta) +class BaseChecks(object): + + """Base class providing upgrade checks. + + Stadium projects which want to provide their own upgrade checks to + neutron-status CLI tool should inherit from this class. + + Each check method have to accept neutron.cmd.status.Checker + class as an argument because all checkes will be run in context of + this class. + """ + + @abc.abstractmethod + def get_checks(self): + """Get tuple with check methods and check names to run.""" + pass diff -Nru python-neutron-lib-1.22.0/neutron_lib/worker.py python-neutron-lib-1.25.0/neutron_lib/worker.py --- python-neutron-lib-1.22.0/neutron_lib/worker.py 2019-01-21 20:24:20.000000000 +0000 +++ python-neutron-lib-1.25.0/neutron_lib/worker.py 2019-02-28 17:08:45.000000000 +0000 @@ -12,7 +12,10 @@ # License for the specific language governing permissions and limitations # under the License. +import os + from oslo_service import service +import setproctitle from neutron_lib.callbacks import events from neutron_lib.callbacks import registry @@ -45,15 +48,24 @@ # default class value for case when super().__init__ is not called _default_process_count = 1 - def __init__(self, worker_process_count=_default_process_count): + def __init__(self, worker_process_count=_default_process_count, + set_proctitle='on'): """Initialize a worker instance. :param worker_process_count: Defines how many processes to spawn for worker: 0 - spawn 1 new worker thread, 1..N - spawn N new worker processes + set_proctitle: + 'off' - do not change process title + 'on' - set process title to descriptive string and parent + 'brief' - set process title to descriptive string """ self._worker_process_count = worker_process_count + self._my_pid = os.getpid() + self._set_proctitle = set_proctitle + if set_proctitle == 'on': + self._parent_proctitle = setproctitle.getproctitle() @property def worker_process_count(self): @@ -63,13 +75,33 @@ """ return self._worker_process_count - def start(self): + def setproctitle(self, name="neutron-server", desc=None): + if self._set_proctitle == "off" or os.getpid() == self._my_pid: + return + + if not desc: + desc = self.__class__.__name__ + + proctitle = "%s: %s" % (name, desc) + if self._set_proctitle == "on": + proctitle += " (%s)" % self._parent_proctitle + + setproctitle.setproctitle(proctitle) + + def start(self, name="neutron-server", desc=None): """Start the worker. If worker_process_count is greater than 0, a callback notification is sent. Subclasses should call this method before doing their own start() work. + + Automatically sets the process title to indicate that this is a + child worker, customizable via the name and desc arguments. + :returns: None """ + + # If we are a child process, set our proctitle to something useful + self.setproctitle(name, desc) if self.worker_process_count > 0: registry.notify(resources.PROCESS, events.AFTER_INIT, self.start) diff -Nru python-neutron-lib-1.22.0/neutron_lib.egg-info/pbr.json python-neutron-lib-1.25.0/neutron_lib.egg-info/pbr.json --- python-neutron-lib-1.22.0/neutron_lib.egg-info/pbr.json 2019-01-21 20:26:17.000000000 +0000 +++ python-neutron-lib-1.25.0/neutron_lib.egg-info/pbr.json 2019-02-28 17:11:52.000000000 +0000 @@ -1 +1 @@ -{"git_version": "9876498", "is_release": true} \ No newline at end of file +{"git_version": "fc2a810", "is_release": true} \ No newline at end of file diff -Nru python-neutron-lib-1.22.0/neutron_lib.egg-info/PKG-INFO python-neutron-lib-1.25.0/neutron_lib.egg-info/PKG-INFO --- python-neutron-lib-1.22.0/neutron_lib.egg-info/PKG-INFO 2019-01-21 20:26:17.000000000 +0000 +++ python-neutron-lib-1.25.0/neutron_lib.egg-info/PKG-INFO 2019-02-28 17:11:52.000000000 +0000 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: neutron-lib -Version: 1.22.0 +Version: 1.25.0 Summary: Neutron shared routines and utilities Home-page: https://docs.openstack.org/neutron-lib/latest/ Author: OpenStack diff -Nru python-neutron-lib-1.22.0/neutron_lib.egg-info/requires.txt python-neutron-lib-1.25.0/neutron_lib.egg-info/requires.txt --- python-neutron-lib-1.22.0/neutron_lib.egg-info/requires.txt 2019-01-21 20:26:17.000000000 +0000 +++ python-neutron-lib-1.25.0/neutron_lib.egg-info/requires.txt 2019-02-28 17:11:52.000000000 +0000 @@ -7,7 +7,7 @@ oslo.concurrency>=3.26.0 oslo.config>=5.2.0 oslo.context>=2.19.2 -oslo.db>=4.27.0 +oslo.db>=4.37.0 oslo.i18n>=3.15.3 oslo.log>=3.36.0 oslo.messaging>=5.29.0 @@ -17,6 +17,7 @@ oslo.utils>=3.33.0 oslo.versionedobjects>=1.31.2 osprofiler>=1.4.0 +setproctitle>=1.1.10 WebOb>=1.7.1 os-traits>=0.9.0 diff -Nru python-neutron-lib-1.22.0/neutron_lib.egg-info/SOURCES.txt python-neutron-lib-1.25.0/neutron_lib.egg-info/SOURCES.txt --- python-neutron-lib-1.22.0/neutron_lib.egg-info/SOURCES.txt 2019-01-21 20:26:17.000000000 +0000 +++ python-neutron-lib-1.25.0/neutron_lib.egg-info/SOURCES.txt 2019-02-28 17:11:52.000000000 +0000 @@ -37,6 +37,7 @@ api-ref/source/v2/fwaas-v2.inc api-ref/source/v2/fwaas.inc api-ref/source/v2/index.rst +api-ref/source/v2/interconnection.inc api-ref/source/v2/intro.inc api-ref/source/v2/l3-agent-scheduler.inc api-ref/source/v2/lbaas-v2.inc @@ -58,6 +59,7 @@ api-ref/source/v2/security-groups.inc api-ref/source/v2/segments.inc api-ref/source/v2/service-providers.inc +api-ref/source/v2/subnetpool_prefix_ops.inc api-ref/source/v2/subnetpools.inc api-ref/source/v2/subnets.inc api-ref/source/v2/tags.inc @@ -182,6 +184,12 @@ api-ref/source/v2/samples/floatingips/floatingip-show-response.json api-ref/source/v2/samples/floatingips/floatingip-update-request.json api-ref/source/v2/samples/floatingips/floatingip-update-response.json +api-ref/source/v2/samples/interconnection/interconnection-create-request.json +api-ref/source/v2/samples/interconnection/interconnection-create-response.json +api-ref/source/v2/samples/interconnection/interconnection-show-response.json +api-ref/source/v2/samples/interconnection/interconnection-update-request.json +api-ref/source/v2/samples/interconnection/interconnection-update-response.json +api-ref/source/v2/samples/interconnection/interconnections-list-response.json api-ref/source/v2/samples/lbaas/healthmonitor-associate-request.json api-ref/source/v2/samples/lbaas/healthmonitor-associate-response.json api-ref/source/v2/samples/lbaas/healthmonitor-create-request.json @@ -378,8 +386,12 @@ api-ref/source/v2/samples/subnets/subnet-show-response.json api-ref/source/v2/samples/subnets/subnet-update-request.json api-ref/source/v2/samples/subnets/subnet-update-response.json +api-ref/source/v2/samples/subnets/subnetpool-add-prefixes-request.json +api-ref/source/v2/samples/subnets/subnetpool-add-prefixes-response.json api-ref/source/v2/samples/subnets/subnetpool-create-request.json api-ref/source/v2/samples/subnets/subnetpool-create-response.json +api-ref/source/v2/samples/subnets/subnetpool-remove-prefixes-request.json +api-ref/source/v2/samples/subnets/subnetpool-remove-prefixes-response.json api-ref/source/v2/samples/subnets/subnetpool-show-response.json api-ref/source/v2/samples/subnets/subnetpool-update-request.json api-ref/source/v2/samples/subnets/subnetpool-update-response.json @@ -440,6 +452,7 @@ doc/source/contributor/api_extensions.rst doc/source/contributor/api_validators.rst doc/source/contributor/callbacks.rst +doc/source/contributor/consuming.rst doc/source/contributor/contributing.rst doc/source/contributor/conventions.rst doc/source/contributor/db_model_query.rst @@ -454,7 +467,6 @@ doc/source/user/index.rst neutron_lib/__init__.py neutron_lib/_i18n.py -neutron_lib/_policy.py neutron_lib/constants.py neutron_lib/context.py neutron_lib/fixture.py @@ -484,6 +496,7 @@ neutron_lib/api/definitions/_dummy.py neutron_lib/api/definitions/address_scope.py neutron_lib/api/definitions/agent.py +neutron_lib/api/definitions/agent_resources_synced.py neutron_lib/api/definitions/allowedaddresspairs.py neutron_lib/api/definitions/auto_allocated_topology.py neutron_lib/api/definitions/availability_zone.py @@ -516,8 +529,10 @@ neutron_lib/api/definitions/firewallrouterinsertion.py neutron_lib/api/definitions/flavors.py neutron_lib/api/definitions/floating_ip_port_forwarding.py +neutron_lib/api/definitions/floatingip_autodelete_internal.py neutron_lib/api/definitions/floatingip_pools.py neutron_lib/api/definitions/flowclassifier.py +neutron_lib/api/definitions/interconnection.py neutron_lib/api/definitions/ip_allocation.py neutron_lib/api/definitions/ip_substring_port_filtering.py neutron_lib/api/definitions/l2_adjacency.py @@ -553,6 +568,7 @@ neutron_lib/api/definitions/qos_gateway_ip.py neutron_lib/api/definitions/qos_rule_type_details.py neutron_lib/api/definitions/qos_rules_alias.py +neutron_lib/api/definitions/rbac_security_groups.py neutron_lib/api/definitions/revisionifmatch.py neutron_lib/api/definitions/router_availability_zone.py neutron_lib/api/definitions/router_interface_fip.py @@ -570,6 +586,7 @@ neutron_lib/api/definitions/subnet_segmentid_enforce.py neutron_lib/api/definitions/subnet_segmentid_writable.py neutron_lib/api/definitions/subnetpool.py +neutron_lib/api/definitions/subnetpool_prefix_ops.py neutron_lib/api/definitions/trunk.py neutron_lib/api/definitions/trunk_details.py neutron_lib/api/definitions/uplink_status_propagation.py @@ -595,6 +612,7 @@ neutron_lib/db/model_base.py neutron_lib/db/model_query.py neutron_lib/db/resource_extend.py +neutron_lib/db/sqlalchemytypes.py neutron_lib/db/utils.py neutron_lib/exceptions/__init__.py neutron_lib/exceptions/address_scope.py @@ -639,22 +657,26 @@ neutron_lib/plugins/utils.py neutron_lib/plugins/ml2/__init__.py neutron_lib/plugins/ml2/api.py +neutron_lib/policy/__init__.py +neutron_lib/policy/_engine.py neutron_lib/services/__init__.py neutron_lib/services/base.py +neutron_lib/services/constants.py neutron_lib/services/qos/__init__.py neutron_lib/services/qos/base.py neutron_lib/services/qos/constants.py +neutron_lib/services/trunk/__init__.py +neutron_lib/services/trunk/constants.py neutron_lib/tests/__init__.py neutron_lib/tests/_base.py neutron_lib/tests/_post_mortem_debug.py -neutron_lib/tests/_tools.py +neutron_lib/tests/tools.py neutron_lib/tests/etc/dummy_policy.json neutron_lib/tests/etc/neutron_lib.conf neutron_lib/tests/etc/no_policy.json neutron_lib/tests/etc/policy.json neutron_lib/tests/unit/__init__.py neutron_lib/tests/unit/fake_notifier.py -neutron_lib/tests/unit/test__policy.py neutron_lib/tests/unit/test_context.py neutron_lib/tests/unit/test_fixture.py neutron_lib/tests/unit/test_neutron_lib.py @@ -671,6 +693,7 @@ neutron_lib/tests/unit/api/definitions/test__dummy.py neutron_lib/tests/unit/api/definitions/test_address_scope.py neutron_lib/tests/unit/api/definitions/test_agent.py +neutron_lib/tests/unit/api/definitions/test_agent_resources_synced.py neutron_lib/tests/unit/api/definitions/test_allowedaddresspairs.py neutron_lib/tests/unit/api/definitions/test_auto_allocated_topology.py neutron_lib/tests/unit/api/definitions/test_availability_zone.py @@ -701,8 +724,10 @@ neutron_lib/tests/unit/api/definitions/test_firewallrouterinsertion.py neutron_lib/tests/unit/api/definitions/test_flavors.py neutron_lib/tests/unit/api/definitions/test_floating_ip_port_forwarding.py +neutron_lib/tests/unit/api/definitions/test_floatingip_autodelete_internal.py neutron_lib/tests/unit/api/definitions/test_floatingip_pools.py neutron_lib/tests/unit/api/definitions/test_flowclassifier.py +neutron_lib/tests/unit/api/definitions/test_interconnection.py neutron_lib/tests/unit/api/definitions/test_ip_substring_port_filtering.py neutron_lib/tests/unit/api/definitions/test_l2_adjancency.py neutron_lib/tests/unit/api/definitions/test_l3.py @@ -737,6 +762,7 @@ neutron_lib/tests/unit/api/definitions/test_qos_gateway_ip.py neutron_lib/tests/unit/api/definitions/test_qos_rule_type_details.py neutron_lib/tests/unit/api/definitions/test_qos_rules_alias.py +neutron_lib/tests/unit/api/definitions/test_rbac_security_groups.py neutron_lib/tests/unit/api/definitions/test_revisionifmatch.py neutron_lib/tests/unit/api/definitions/test_router_availability_zone.py neutron_lib/tests/unit/api/definitions/test_router_interface_fip.py @@ -754,6 +780,7 @@ neutron_lib/tests/unit/api/definitions/test_subnet_segmentid_enforce.py neutron_lib/tests/unit/api/definitions/test_subnet_segmentid_writable.py neutron_lib/tests/unit/api/definitions/test_subnetpool.py +neutron_lib/tests/unit/api/definitions/test_subnetpool_prefix_ops.py neutron_lib/tests/unit/api/definitions/test_trunk.py neutron_lib/tests/unit/api/definitions/test_trunk_details.py neutron_lib/tests/unit/api/definitions/test_uplink_status_propagation.py @@ -779,6 +806,7 @@ neutron_lib/tests/unit/db/test_model_base.py neutron_lib/tests/unit/db/test_model_query.py neutron_lib/tests/unit/db/test_resource_extend.py +neutron_lib/tests/unit/db/test_sqlalchemytypes.py neutron_lib/tests/unit/db/test_utils.py neutron_lib/tests/unit/exceptions/__init__.py neutron_lib/tests/unit/exceptions/test_exceptions.py @@ -795,6 +823,8 @@ neutron_lib/tests/unit/plugins/test_utils.py neutron_lib/tests/unit/plugins/ml2/__init__.py neutron_lib/tests/unit/plugins/ml2/test_api.py +neutron_lib/tests/unit/policy/__init__.py +neutron_lib/tests/unit/policy/test__engine.py neutron_lib/tests/unit/services/__init__.py neutron_lib/tests/unit/services/test_base.py neutron_lib/tests/unit/services/qos/__init__.py @@ -813,10 +843,13 @@ neutron_lib/utils/net.py neutron_lib/utils/runtime.py neutron_lib/utils/test.py +neutron_lib/utils/upgrade_checks.py releasenotes/notes/.placeholder +releasenotes/notes/add-a-getter-for-a-newly-added-option-2082877bf7dd136b.yaml releasenotes/notes/add-action-status-3dbfe2490a0d231a.yaml releasenotes/notes/add-api-extension-sort-key-validation-b42f5839671fe5f5.yaml releasenotes/notes/add-availability_zone_filter-extension-e91e1e5e822e4133.yaml +releasenotes/notes/add-base-upgrade-checks-class-f6da1d501663d8c5.yaml releasenotes/notes/add-can-port-be-bound-to-virtual-bridge-5d6db8785e58fcb9.yaml releasenotes/notes/add-convert-to-string-524541aa6224f66f.yaml releasenotes/notes/add-directory-is-loaded-e9da5b65824dddad.yaml @@ -832,10 +865,14 @@ releasenotes/notes/add-is-default-to-network-d16a2e6bcfae943a.yaml releasenotes/notes/add-is_filter-keyword-to-attribute-maps-3fa31e91c353d033.yaml releasenotes/notes/add-is_sort_key-keyword-to-attribute-map-75342446d99f4490.yaml +releasenotes/notes/add-network-segment-range-overlap-exception-e8b4b2b425c51c80.yaml +releasenotes/notes/add-network-segment-range-plugin-constant-9e80453919162c89.yaml releasenotes/notes/add-ovo-registry-27cb7d4ac76d4dc8.yaml releasenotes/notes/add-port-binding-resource-73f9800dbda121ca.yaml releasenotes/notes/add-port-bindings-resource-messages-rpc-1382ba9842561cdb.yaml releasenotes/notes/add-port_details-to-floatingip-a2a3c95cc54737ac.yaml +releasenotes/notes/add-rbac-security-groups-2e47acd9eac3a320.yaml +releasenotes/notes/add-router-not-found-in-factory-exception-e2bf9431549ff9b9.yaml releasenotes/notes/add-support-for-fetching-specific-column-in-OVO-81b764b203849776.yaml releasenotes/notes/add-traffic-control-exceptions-0e137dae3a556d54.yaml releasenotes/notes/add-two-fields-to-duplicated-entry-exception-75b0e07c6e1cc6ae.yaml @@ -846,6 +883,7 @@ releasenotes/notes/add-vnic-virtio-forwarder-portbinding-f7f87dfbef456ed1.yaml releasenotes/notes/add_fwg_group-9252d07f1011613d.yaml releasenotes/notes/advsvc-role-support-d4f1c532264b729a.yaml +releasenotes/notes/agent-resources-synced-e70828841faf7acd.yaml releasenotes/notes/agent_extensions-2b497ff33c6dc3e8.yaml releasenotes/notes/alembic-branches-6d5947d141efd26e.yaml releasenotes/notes/api-definition-base-d2e9514c5ee2ef5b.yaml @@ -874,10 +912,13 @@ releasenotes/notes/events_l3_flavors-053714858ced693d.yaml releasenotes/notes/expose-and-enhance-callback-api-714cce65a3c44fe7.yaml releasenotes/notes/expose-port-forwarding-in-fip-a7880506cea0ad1d.yaml +releasenotes/notes/extend-segment-methods-with-filters-6e74953ae2d3b828.yaml releasenotes/notes/extension-fixture-b7fd61384f1a4d1d.yaml releasenotes/notes/extension_descriptor-04025e86249cc94c.yaml releasenotes/notes/extra-dhcp-opt-public-vars-ec4e1c2dcac43d69.yaml releasenotes/notes/fip64-0c6bb38417d602f1.yaml +releasenotes/notes/floatingip-autodelete-internal-dep-8e544fad694d1275.yaml +releasenotes/notes/floatingip-autodelete-internal-f08675d8d64d34c6.yaml releasenotes/notes/floatingip-portforwarding-17c284080541bc78.yaml releasenotes/notes/flush_on_subtransaction-99ef11dfb56b706d.yaml releasenotes/notes/fwaas-api-def-a6f03db369177b4a.yaml @@ -885,7 +926,9 @@ releasenotes/notes/fwaas_converters_validators-c310900b4386146e.yaml releasenotes/notes/gateway-ip-qos-ext-d3ffb5f517c9f713.yaml releasenotes/notes/hacking-check-n537-280ec39c061d9dd7.yaml +releasenotes/notes/interconnection-api-def-cbec5e4f77852fe7.yaml releasenotes/notes/introduce-logging-api-031d00eb84d5d061.yaml +releasenotes/notes/introduce_subnetpool_prefix_ops_extension-e37874c936d2554c.yaml releasenotes/notes/ipv6-canonical-address-13900a784f847ce3.yaml releasenotes/notes/ipv6_address_usage-ef3d65ad5aa5798b.yaml releasenotes/notes/l3-agent-extensions-ha-state-change-837140efe4187a99.yaml @@ -897,11 +940,15 @@ releasenotes/notes/mac-generator-f927df2fe57300c0.yaml releasenotes/notes/migrate-public-to-shared-0c67b32f9c37c751.yaml releasenotes/notes/move-get-random-mac-98f47d81cb34483d.yaml +releasenotes/notes/move-segment-range-types-to-lib-constants-d45c6959607e9136.yaml releasenotes/notes/moved-netmtu-extension-5999348000adcfaf.yaml releasenotes/notes/network-segment-range-ext-2b93b7fa42310c25.yaml releasenotes/notes/new-hacking-check-no-log-translations-4a430a38aeb06452.yaml +releasenotes/notes/new-policy-module-f5638e23fe91a287.yaml releasenotes/notes/new-validator-range-or-none-dc8d557ec1f2622a.yaml releasenotes/notes/one-hacking-factory-01053e8e3d88c3d5.yaml +releasenotes/notes/oslo-db-jitter-c4d13cc81755203e.yaml +releasenotes/notes/placement-binding-exceptions-6362d52391b7023e.yaml releasenotes/notes/placement-client-bump-latest-supported-version-to-1-20-fe96751dab42399b.yaml releasenotes/notes/placement-client-do-not-swallow-exceptions-c33c9a9224a27551.yaml releasenotes/notes/placement-client-move-9f292ae2067c119c.yaml @@ -931,6 +978,7 @@ releasenotes/notes/rehome-api-faults-cf30246e5e5bf8b8.yaml releasenotes/notes/rehome-autotopology-apidef-4a77e8ba0c783f7e.yaml releasenotes/notes/rehome-az-apidef-1e63cbd2359994fa.yaml +releasenotes/notes/rehome-common-constants-52f39a79e8eabd7e.yaml releasenotes/notes/rehome-common-constants-8ac9580e52fd3618.yaml releasenotes/notes/rehome-common-exceptions-eda074ddb02349ab.yaml releasenotes/notes/rehome-common-rpc-5d84a9fe0faa71b7.yaml @@ -987,13 +1035,17 @@ releasenotes/notes/rehome-segment-apidef-a5f81adb834328f8.yaml releasenotes/notes/rehome-shared-const-d847b2e190122425.yaml releasenotes/notes/rehome-sorting-apidef-1547f093da322c14.yaml +releasenotes/notes/rehome-sqlalchemytypes-14817eb6694463db.yaml releasenotes/notes/rehome-svctype-apidef-9002b2e2bcbeec8e.yaml releasenotes/notes/rehome-topics-ca451e72c8c9603a.yaml +releasenotes/notes/rehome-trunk-callback-resources-be40f8382490ef0d.yaml +releasenotes/notes/rehome-trunk-consts-407e4590e9386d19.yaml releasenotes/notes/rehome-unstable-test-decorator-a062301ac7d7a082.yaml releasenotes/notes/rehome-vlantransp-apidef-1cd7d3ace9042686.yaml releasenotes/notes/rehome-worker-b7e9c7f477bdb926.yaml releasenotes/notes/remove-ensure_dir-aed59b616e02a2bb.yaml releasenotes/notes/remove-hacking-check-n523-014d163a5ae23adb.yaml +releasenotes/notes/remove-neutron-lib-from-db-profiling-38436898d8e45b37.yaml releasenotes/notes/remove_label-801d7a1b13f179fa.yaml releasenotes/notes/reset-db-retry-settings-49e51cef4c842f69.yaml releasenotes/notes/resource-provider-uuid5-namespace-f7276ba1945ce82f.yaml @@ -1005,6 +1057,7 @@ releasenotes/notes/router-interface-fip-1e79b7909f8b264f.yaml releasenotes/notes/separate-hacking-factories-6fc36b38de95662a.yaml releasenotes/notes/service-plugin-base-a42c2241a2fe0d26.yaml +releasenotes/notes/setproctitle_for_workers-e8805fcaf34026ab.yaml releasenotes/notes/sfc-api-def-4f46632eadfe895a.yaml releasenotes/notes/std_attributes_bgpvpn-5a1c63f68d1ff6be.yaml releasenotes/notes/subnet-onboard-allow-create-update-subnets-74a4be6e9e97bbb6.yaml @@ -1013,10 +1066,12 @@ releasenotes/notes/subnet_segmentid_writable-e28a85033272f05d.yaml releasenotes/notes/subresource-update-attrmap-and-classmethods-76accdd5c56a3bd4.yaml releasenotes/notes/support-custom-filter-f4a15bb5b38b7d3e.yaml +releasenotes/notes/traffic-control-constants-b8120d1bea0681bf.yaml releasenotes/notes/transaction_constraint-d3f93c2ced4a74c6.yaml releasenotes/notes/trunk-api-08bfdcdd80f7e666.yaml releasenotes/notes/update-hacking-check-n536-2f63898bea693125.yaml releasenotes/notes/update-segment-api-definition-d7297e73e76a754c.yaml +releasenotes/notes/update-subnet-onboard-api-267a9a37f6426d64.yaml releasenotes/notes/validator_ip_or_subnet_or_none-0175f906a9113954.yaml releasenotes/notes/vnic-type-smart-nic-45dd5a22a9d1aa63.yaml releasenotes/notes/vpn-api-def-52970461fac0f7d2.yaml diff -Nru python-neutron-lib-1.22.0/PKG-INFO python-neutron-lib-1.25.0/PKG-INFO --- python-neutron-lib-1.22.0/PKG-INFO 2019-01-21 20:26:17.000000000 +0000 +++ python-neutron-lib-1.25.0/PKG-INFO 2019-02-28 17:11:53.000000000 +0000 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: neutron-lib -Version: 1.22.0 +Version: 1.25.0 Summary: Neutron shared routines and utilities Home-page: https://docs.openstack.org/neutron-lib/latest/ Author: OpenStack diff -Nru python-neutron-lib-1.22.0/releasenotes/notes/add-a-getter-for-a-newly-added-option-2082877bf7dd136b.yaml python-neutron-lib-1.25.0/releasenotes/notes/add-a-getter-for-a-newly-added-option-2082877bf7dd136b.yaml --- python-neutron-lib-1.22.0/releasenotes/notes/add-a-getter-for-a-newly-added-option-2082877bf7dd136b.yaml 1970-01-01 00:00:00.000000000 +0000 +++ python-neutron-lib-1.25.0/releasenotes/notes/add-a-getter-for-a-newly-added-option-2082877bf7dd136b.yaml 2019-02-28 17:08:45.000000000 +0000 @@ -0,0 +1,5 @@ +--- +features: + - Maximum rpc timeout is now configurable by ``rpc_response_max_timeout`` + from Neutron config instead of being calculated as ``10 * + rpc_response_timeout`` value. diff -Nru python-neutron-lib-1.22.0/releasenotes/notes/add-base-upgrade-checks-class-f6da1d501663d8c5.yaml python-neutron-lib-1.25.0/releasenotes/notes/add-base-upgrade-checks-class-f6da1d501663d8c5.yaml --- python-neutron-lib-1.22.0/releasenotes/notes/add-base-upgrade-checks-class-f6da1d501663d8c5.yaml 1970-01-01 00:00:00.000000000 +0000 +++ python-neutron-lib-1.25.0/releasenotes/notes/add-base-upgrade-checks-class-f6da1d501663d8c5.yaml 2019-02-28 17:08:45.000000000 +0000 @@ -0,0 +1,6 @@ +--- +other: + - | + Base class for upgrade checks used in checks in + ``neutron-status upgrade check`` tool is now available in + ``neutron_lib.utils.upgrade_checks`` and can be reused by other projects. diff -Nru python-neutron-lib-1.22.0/releasenotes/notes/add-network-segment-range-overlap-exception-e8b4b2b425c51c80.yaml python-neutron-lib-1.25.0/releasenotes/notes/add-network-segment-range-overlap-exception-e8b4b2b425c51c80.yaml --- python-neutron-lib-1.22.0/releasenotes/notes/add-network-segment-range-overlap-exception-e8b4b2b425c51c80.yaml 1970-01-01 00:00:00.000000000 +0000 +++ python-neutron-lib-1.25.0/releasenotes/notes/add-network-segment-range-overlap-exception-e8b4b2b425c51c80.yaml 2019-02-28 17:08:45.000000000 +0000 @@ -0,0 +1,5 @@ +--- +features: + - | + Add ``NetworkSegmentRangeOverlaps`` exception to prevent overlapping + network segment ranges on creation. diff -Nru python-neutron-lib-1.22.0/releasenotes/notes/add-network-segment-range-plugin-constant-9e80453919162c89.yaml python-neutron-lib-1.25.0/releasenotes/notes/add-network-segment-range-plugin-constant-9e80453919162c89.yaml --- python-neutron-lib-1.22.0/releasenotes/notes/add-network-segment-range-plugin-constant-9e80453919162c89.yaml 1970-01-01 00:00:00.000000000 +0000 +++ python-neutron-lib-1.25.0/releasenotes/notes/add-network-segment-range-plugin-constant-9e80453919162c89.yaml 2019-02-28 17:08:45.000000000 +0000 @@ -0,0 +1,5 @@ +other: + - | + Add the ``neutron_lib.plugins.constants.NETWORK_SEGMENT_RANGE`` constant so + that it can be used elsewhere related to the ``network_segment_range`` + service plugin. diff -Nru python-neutron-lib-1.22.0/releasenotes/notes/add-rbac-security-groups-2e47acd9eac3a320.yaml python-neutron-lib-1.25.0/releasenotes/notes/add-rbac-security-groups-2e47acd9eac3a320.yaml --- python-neutron-lib-1.22.0/releasenotes/notes/add-rbac-security-groups-2e47acd9eac3a320.yaml 1970-01-01 00:00:00.000000000 +0000 +++ python-neutron-lib-1.25.0/releasenotes/notes/add-rbac-security-groups-2e47acd9eac3a320.yaml 2019-02-28 17:08:45.000000000 +0000 @@ -0,0 +1,4 @@ +features: + - | + Adds API definition for ``rbac-security-groups`` extension, which allows + sharing security groups between tenants via the network RBAC mechanism. diff -Nru python-neutron-lib-1.22.0/releasenotes/notes/add-router-not-found-in-factory-exception-e2bf9431549ff9b9.yaml python-neutron-lib-1.25.0/releasenotes/notes/add-router-not-found-in-factory-exception-e2bf9431549ff9b9.yaml --- python-neutron-lib-1.22.0/releasenotes/notes/add-router-not-found-in-factory-exception-e2bf9431549ff9b9.yaml 1970-01-01 00:00:00.000000000 +0000 +++ python-neutron-lib-1.25.0/releasenotes/notes/add-router-not-found-in-factory-exception-e2bf9431549ff9b9.yaml 2019-02-28 17:08:45.000000000 +0000 @@ -0,0 +1,4 @@ +--- +features: + - Adds new L3 exception ``RouterNotFoundInRouterFactory`` in + ``neutron_lib.exceptions.l3``. diff -Nru python-neutron-lib-1.22.0/releasenotes/notes/agent-resources-synced-e70828841faf7acd.yaml python-neutron-lib-1.25.0/releasenotes/notes/agent-resources-synced-e70828841faf7acd.yaml --- python-neutron-lib-1.22.0/releasenotes/notes/agent-resources-synced-e70828841faf7acd.yaml 1970-01-01 00:00:00.000000000 +0000 +++ python-neutron-lib-1.25.0/releasenotes/notes/agent-resources-synced-e70828841faf7acd.yaml 2019-02-28 17:08:45.000000000 +0000 @@ -0,0 +1,6 @@ +--- +features: + - | + The ``agent-resources-synced`` extension introduces a new agent + attribute named ``resources_synced`` that tracks the success of + the resource view synchronization to Placement. diff -Nru python-neutron-lib-1.22.0/releasenotes/notes/extend-segment-methods-with-filters-6e74953ae2d3b828.yaml python-neutron-lib-1.25.0/releasenotes/notes/extend-segment-methods-with-filters-6e74953ae2d3b828.yaml --- python-neutron-lib-1.22.0/releasenotes/notes/extend-segment-methods-with-filters-6e74953ae2d3b828.yaml 1970-01-01 00:00:00.000000000 +0000 +++ python-neutron-lib-1.25.0/releasenotes/notes/extend-segment-methods-with-filters-6e74953ae2d3b828.yaml 2019-02-28 17:08:45.000000000 +0000 @@ -0,0 +1,7 @@ +--- +features: + - | + Extend the ML2 type driver abstract methods ``reserve_provider_segment`` + and ``allocate_tenant_segment`` with ``filters`` that is used as search + criteria for the segment allocation support when network-segment-range + extension is loaded. diff -Nru python-neutron-lib-1.22.0/releasenotes/notes/floatingip-autodelete-internal-dep-8e544fad694d1275.yaml python-neutron-lib-1.25.0/releasenotes/notes/floatingip-autodelete-internal-dep-8e544fad694d1275.yaml --- python-neutron-lib-1.22.0/releasenotes/notes/floatingip-autodelete-internal-dep-8e544fad694d1275.yaml 1970-01-01 00:00:00.000000000 +0000 +++ python-neutron-lib-1.25.0/releasenotes/notes/floatingip-autodelete-internal-dep-8e544fad694d1275.yaml 2019-02-28 17:08:45.000000000 +0000 @@ -0,0 +1,5 @@ +--- +other: + - | + For technical reasons the ``floatingip-autodelete-internal`` extension + no longer requires the ``router`` extension. diff -Nru python-neutron-lib-1.22.0/releasenotes/notes/floatingip-autodelete-internal-f08675d8d64d34c6.yaml python-neutron-lib-1.25.0/releasenotes/notes/floatingip-autodelete-internal-f08675d8d64d34c6.yaml --- python-neutron-lib-1.22.0/releasenotes/notes/floatingip-autodelete-internal-f08675d8d64d34c6.yaml 1970-01-01 00:00:00.000000000 +0000 +++ python-neutron-lib-1.25.0/releasenotes/notes/floatingip-autodelete-internal-f08675d8d64d34c6.yaml 2019-02-28 17:08:45.000000000 +0000 @@ -0,0 +1,4 @@ +--- +features: + - | + New shim API extension: ``floatingip-autodelete-internal``. diff -Nru python-neutron-lib-1.22.0/releasenotes/notes/interconnection-api-def-cbec5e4f77852fe7.yaml python-neutron-lib-1.25.0/releasenotes/notes/interconnection-api-def-cbec5e4f77852fe7.yaml --- python-neutron-lib-1.22.0/releasenotes/notes/interconnection-api-def-cbec5e4f77852fe7.yaml 1970-01-01 00:00:00.000000000 +0000 +++ python-neutron-lib-1.25.0/releasenotes/notes/interconnection-api-def-cbec5e4f77852fe7.yaml 2019-02-28 17:08:45.000000000 +0000 @@ -0,0 +1,4 @@ +--- +features: + - Adds definition of ``interconnection`` API extension for + neutron-interconnection project. \ No newline at end of file diff -Nru python-neutron-lib-1.22.0/releasenotes/notes/introduce_subnetpool_prefix_ops_extension-e37874c936d2554c.yaml python-neutron-lib-1.25.0/releasenotes/notes/introduce_subnetpool_prefix_ops_extension-e37874c936d2554c.yaml --- python-neutron-lib-1.22.0/releasenotes/notes/introduce_subnetpool_prefix_ops_extension-e37874c936d2554c.yaml 1970-01-01 00:00:00.000000000 +0000 +++ python-neutron-lib-1.25.0/releasenotes/notes/introduce_subnetpool_prefix_ops_extension-e37874c936d2554c.yaml 2019-02-28 17:08:45.000000000 +0000 @@ -0,0 +1,5 @@ +--- +features: + - Adds ``subnetpool-prefix-ops`` API definition to neutron-lib. This + extension introduces API's that provide explicit support for removing + prefixes from a subnet pool and adding subnets to a subnet pool. diff -Nru python-neutron-lib-1.22.0/releasenotes/notes/move-segment-range-types-to-lib-constants-d45c6959607e9136.yaml python-neutron-lib-1.25.0/releasenotes/notes/move-segment-range-types-to-lib-constants-d45c6959607e9136.yaml --- python-neutron-lib-1.22.0/releasenotes/notes/move-segment-range-types-to-lib-constants-d45c6959607e9136.yaml 1970-01-01 00:00:00.000000000 +0000 +++ python-neutron-lib-1.25.0/releasenotes/notes/move-segment-range-types-to-lib-constants-d45c6959607e9136.yaml 2019-02-28 17:08:45.000000000 +0000 @@ -0,0 +1,6 @@ +--- +other: + - | + The ``neutron_lib.api.definitions.network_segment_range.NETWORK_SEGMENT_RANGE_TYPE_LIST`` + constant was moved to ``neutron_lib.constants`` and renamed to + ``NETWORK_SEGMENT_RANGE_TYPES`` so that it can be used elsewhere. diff -Nru python-neutron-lib-1.22.0/releasenotes/notes/new-policy-module-f5638e23fe91a287.yaml python-neutron-lib-1.25.0/releasenotes/notes/new-policy-module-f5638e23fe91a287.yaml --- python-neutron-lib-1.22.0/releasenotes/notes/new-policy-module-f5638e23fe91a287.yaml 1970-01-01 00:00:00.000000000 +0000 +++ python-neutron-lib-1.25.0/releasenotes/notes/new-policy-module-f5638e23fe91a287.yaml 2019-02-28 17:08:45.000000000 +0000 @@ -0,0 +1,10 @@ +--- +other: + - | + New module ``neutron_lib.policy`` was added. + It contains constants: ``RULE_ADMIN_OR_OWNER``, ``RULE_ADMIN_ONLY``, + ``RULE_ANY``, ``RULE_ADVSVC``, ``RULE_ADMIN_OR_NET_OWNER``, + ``RULE_ADMIN_OR_NET_OWNER_OR_ADVSVC`` and ``RULE_ADMIN_OR_PARENT_OWNER``. + It contains also helper functions ``policy_and`` and ``policy_or``. + Those constants and functions can be used in policy modules in Neutron + related projects. diff -Nru python-neutron-lib-1.22.0/releasenotes/notes/oslo-db-jitter-c4d13cc81755203e.yaml python-neutron-lib-1.25.0/releasenotes/notes/oslo-db-jitter-c4d13cc81755203e.yaml --- python-neutron-lib-1.22.0/releasenotes/notes/oslo-db-jitter-c4d13cc81755203e.yaml 1970-01-01 00:00:00.000000000 +0000 +++ python-neutron-lib-1.25.0/releasenotes/notes/oslo-db-jitter-c4d13cc81755203e.yaml 2019-02-28 17:08:45.000000000 +0000 @@ -0,0 +1,5 @@ +--- +fixes: + - The oslo.db wrap_db_retry function now supports randomized time jitter + in its retry algorithm. Add support for that feature, if the installed + version of oslo.db supports it. diff -Nru python-neutron-lib-1.22.0/releasenotes/notes/placement-binding-exceptions-6362d52391b7023e.yaml python-neutron-lib-1.25.0/releasenotes/notes/placement-binding-exceptions-6362d52391b7023e.yaml --- python-neutron-lib-1.22.0/releasenotes/notes/placement-binding-exceptions-6362d52391b7023e.yaml 1970-01-01 00:00:00.000000000 +0000 +++ python-neutron-lib-1.25.0/releasenotes/notes/placement-binding-exceptions-6362d52391b7023e.yaml 2019-02-28 17:08:45.000000000 +0000 @@ -0,0 +1,5 @@ +--- +features: + - | + New exception classes: ``UnknownResourceProvider`` and + ``AmbiguousResponsibilityForResourceProvider``. diff -Nru python-neutron-lib-1.22.0/releasenotes/notes/rehome-common-constants-52f39a79e8eabd7e.yaml python-neutron-lib-1.25.0/releasenotes/notes/rehome-common-constants-52f39a79e8eabd7e.yaml --- python-neutron-lib-1.22.0/releasenotes/notes/rehome-common-constants-52f39a79e8eabd7e.yaml 1970-01-01 00:00:00.000000000 +0000 +++ python-neutron-lib-1.25.0/releasenotes/notes/rehome-common-constants-52f39a79e8eabd7e.yaml 2019-02-28 17:08:45.000000000 +0000 @@ -0,0 +1,6 @@ +--- +features: + - The remaining ``neutron.common.constants`` are now available in + ``neutron_lib.constants`` with the exception of + ``EXT_PARENT_RESOURCE_MAPPING`` that is now available in + ``neutron_lib.services.constants``. diff -Nru python-neutron-lib-1.22.0/releasenotes/notes/rehome-sqlalchemytypes-14817eb6694463db.yaml python-neutron-lib-1.25.0/releasenotes/notes/rehome-sqlalchemytypes-14817eb6694463db.yaml --- python-neutron-lib-1.22.0/releasenotes/notes/rehome-sqlalchemytypes-14817eb6694463db.yaml 1970-01-01 00:00:00.000000000 +0000 +++ python-neutron-lib-1.25.0/releasenotes/notes/rehome-sqlalchemytypes-14817eb6694463db.yaml 2019-02-28 17:08:45.000000000 +0000 @@ -0,0 +1,5 @@ +--- +features: + - The ``neutron_lib.tests._tools`` module is now public and named + ``tools``. + - The ``sqlalchemytypes`` module is now available in ``neutron_lib.db``. diff -Nru python-neutron-lib-1.22.0/releasenotes/notes/rehome-trunk-callback-resources-be40f8382490ef0d.yaml python-neutron-lib-1.25.0/releasenotes/notes/rehome-trunk-callback-resources-be40f8382490ef0d.yaml --- python-neutron-lib-1.22.0/releasenotes/notes/rehome-trunk-callback-resources-be40f8382490ef0d.yaml 1970-01-01 00:00:00.000000000 +0000 +++ python-neutron-lib-1.25.0/releasenotes/notes/rehome-trunk-callback-resources-be40f8382490ef0d.yaml 2019-02-28 17:08:45.000000000 +0000 @@ -0,0 +1,5 @@ +--- +features: + - The ``SUBPORTS``, ``TRUNK`` and ``TRUNK_PLUGIN`` constants are now + available in ``neutron_lib.callbacks.resources`` for defining Trunk + related callback resources. diff -Nru python-neutron-lib-1.22.0/releasenotes/notes/rehome-trunk-consts-407e4590e9386d19.yaml python-neutron-lib-1.25.0/releasenotes/notes/rehome-trunk-consts-407e4590e9386d19.yaml --- python-neutron-lib-1.22.0/releasenotes/notes/rehome-trunk-consts-407e4590e9386d19.yaml 1970-01-01 00:00:00.000000000 +0000 +++ python-neutron-lib-1.25.0/releasenotes/notes/rehome-trunk-consts-407e4590e9386d19.yaml 2019-02-28 17:08:45.000000000 +0000 @@ -0,0 +1,5 @@ +--- +features: + - The trunk service constants are now available in + ``neutron_lib.services.trunk.constants``, but now have the + constant name prefixed with ``TRUNK_``. diff -Nru python-neutron-lib-1.22.0/releasenotes/notes/remove-neutron-lib-from-db-profiling-38436898d8e45b37.yaml python-neutron-lib-1.25.0/releasenotes/notes/remove-neutron-lib-from-db-profiling-38436898d8e45b37.yaml --- python-neutron-lib-1.22.0/releasenotes/notes/remove-neutron-lib-from-db-profiling-38436898d8e45b37.yaml 1970-01-01 00:00:00.000000000 +0000 +++ python-neutron-lib-1.25.0/releasenotes/notes/remove-neutron-lib-from-db-profiling-38436898d8e45b37.yaml 2019-02-28 17:08:45.000000000 +0000 @@ -0,0 +1,9 @@ +--- +other: + - | + Module ``neutron_lib.db`` is now removed from db profiling projects so + database calls done from this module will not be tracked in osprofiler + results. + All db calls which are tracked by osprofiler are comming from + Neutron and this avoids having each call logged twice in osprofiler + report. diff -Nru python-neutron-lib-1.22.0/releasenotes/notes/setproctitle_for_workers-e8805fcaf34026ab.yaml python-neutron-lib-1.25.0/releasenotes/notes/setproctitle_for_workers-e8805fcaf34026ab.yaml --- python-neutron-lib-1.22.0/releasenotes/notes/setproctitle_for_workers-e8805fcaf34026ab.yaml 1970-01-01 00:00:00.000000000 +0000 +++ python-neutron-lib-1.25.0/releasenotes/notes/setproctitle_for_workers-e8805fcaf34026ab.yaml 2019-02-28 17:08:45.000000000 +0000 @@ -0,0 +1,27 @@ +features: + - | + ``neutron_lib.worker.BaseWorker`` will now set the process title + on process start, if it is a new process. By default, the name + will be "neutron-server", and the description will be the name + of the worker class, followed by the original process title. + Both fields are customizable via the ``name`` and ``desc`` + arguments to ``BaseWorker.start()``, and the change + can be disabled via the ``set_proctitle`` argument to the + ``__init__`` function. ``neutron.conf`` will have a setting + for disabling this functionality for all in-tree workers, but + by default, all out of tree plugin workers will set their name + at fork time. Available settings are 'on' (described above, and + the default), 'off' (same as today), or 'brief', which settings + the process name to just name and description. 'brief' is probably + most useful/simple for deployers, but 'on' is the default in order + to prevent as many script related breakages as possible. +upgrade: + - Any plugin which forks worker processes from neutron-server will + have its proctitle set to "neutron-server" plus a classname in ps + output. Any tool used for monitoring/maintenance that watches + the process table should be modified to only look for the string + ``neutron-server``. On the plus side, it will now be possible + to distinguish which process belongs to which plugin, based on + the new naming. Note that the original process string is still + in the proctitle, so as long as the scripting is not looking for + a perfect string match, it should continue to work. diff -Nru python-neutron-lib-1.22.0/releasenotes/notes/traffic-control-constants-b8120d1bea0681bf.yaml python-neutron-lib-1.25.0/releasenotes/notes/traffic-control-constants-b8120d1bea0681bf.yaml --- python-neutron-lib-1.22.0/releasenotes/notes/traffic-control-constants-b8120d1bea0681bf.yaml 1970-01-01 00:00:00.000000000 +0000 +++ python-neutron-lib-1.25.0/releasenotes/notes/traffic-control-constants-b8120d1bea0681bf.yaml 2019-02-28 17:08:45.000000000 +0000 @@ -0,0 +1,9 @@ +--- +features: + - | + Adds traffic control related constants: + + * Qdisc types: ``htb``, ``tbf`` and ``ingress``, used in Neutron ``tc_lib`` + * Qdisc ID: for ``ingress`` type, because this one is specific only for + ingress traffic. + * Qdisc parents: for ``root`` and ``ingress`` types. diff -Nru python-neutron-lib-1.22.0/releasenotes/notes/update-subnet-onboard-api-267a9a37f6426d64.yaml python-neutron-lib-1.25.0/releasenotes/notes/update-subnet-onboard-api-267a9a37f6426d64.yaml --- python-neutron-lib-1.22.0/releasenotes/notes/update-subnet-onboard-api-267a9a37f6426d64.yaml 1970-01-01 00:00:00.000000000 +0000 +++ python-neutron-lib-1.25.0/releasenotes/notes/update-subnet-onboard-api-267a9a37f6426d64.yaml 2019-02-28 17:08:45.000000000 +0000 @@ -0,0 +1,8 @@ +--- +other: + - | + This change removes the ``ONBOARD_SUBNETS_SPECS`` attribute extension + from the subnet onboard extension descriptor. This has been deemed to + be an unnecessary attribute extension during implementation and has been + removed. Because subnet onboard is not yet a completed Neutron feature, + the API definition is being updated to reflect this. diff -Nru python-neutron-lib-1.22.0/requirements.txt python-neutron-lib-1.25.0/requirements.txt --- python-neutron-lib-1.22.0/requirements.txt 2019-01-21 20:24:20.000000000 +0000 +++ python-neutron-lib-1.25.0/requirements.txt 2019-02-28 17:08:45.000000000 +0000 @@ -12,7 +12,7 @@ oslo.concurrency>=3.26.0 # Apache-2.0 oslo.config>=5.2.0 # Apache-2.0 oslo.context>=2.19.2 # Apache-2.0 -oslo.db>=4.27.0 # Apache-2.0 +oslo.db>=4.37.0 # Apache-2.0 oslo.i18n>=3.15.3 # Apache-2.0 oslo.log>=3.36.0 # Apache-2.0 oslo.messaging>=5.29.0 # Apache-2.0 @@ -22,6 +22,7 @@ oslo.utils>=3.33.0 # Apache-2.0 oslo.versionedobjects>=1.31.2 # Apache-2.0 osprofiler>=1.4.0 # Apache-2.0 +setproctitle>=1.1.10 # BSD WebOb>=1.7.1 # MIT weakrefmethod>=1.0.2;python_version=='2.7' # PSF os-traits>=0.9.0 # Apache-2.0 diff -Nru python-neutron-lib-1.22.0/.zuul.yaml python-neutron-lib-1.25.0/.zuul.yaml --- python-neutron-lib-1.22.0/.zuul.yaml 2019-01-21 20:24:20.000000000 +0000 +++ python-neutron-lib-1.25.0/.zuul.yaml 2019-02-28 17:08:45.000000000 +0000 @@ -7,6 +7,31 @@ - openstack-python-jobs - openstack-python35-jobs - openstack-python36-jobs + - openstack-python37-jobs - lib-forward-testing - lib-forward-testing-python3 - release-notes-jobs-python3 + check: + jobs: + # This job comes from lib-forward-testing template, + # but it is limited to 2h there and we want to set + # for it 3h timeout + - tempest-full: + timeout: 10800 + # This job comes from lib-forward-testing-python3 template, + # but it is limited to 2h there and we want to set + # for it 3h timeout + - tempest-full-py3: + timeout: 10800 + gate: + jobs: + # This job comes from lib-forward-testing template, + # but it is limited to 2h there and we want to set + # for it 3h timeout + - tempest-full: + timeout: 10800 + # This job comes from lib-forward-testing-python3 template, + # but it is limited to 2h there and we want to set + # for it 3h timeout + - tempest-full-py3: + timeout: 10800