Endpoint type is ignored for network commands

Bug #1592368 reported by Stuart McLaren on 2016-06-14
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-openstackclient
Fix Released
Undecided
Stuart McLaren

Bug Description

If I have several network endpoint types defined:

$ openstack endpoint list |grep neutron
| 097fb40857b64fdcaf609dbc8c85663b | region1 | neutron | network | True | admin | https://192.168.245.5:9696/ |
| 25ed4d64a9d44cb59f2f280038b722d9 | region1 | neutron | network | True | internal | https://192.168.245.5:9696/ |
| 42142cf6067248ab90c4771cb8a39bb0 | region1 | neutron | network | True | public | https://myhelion.test:9696/ |

All "openstack network xxx" commands hit the public endpoint, even if OS_ENDPOINT_TYPE or --os-interface are specified.

Eg

$ openstack --debug --os-interface internal network list
.
.
.

REQ: curl -g -i -X GET https://myhelion.test:9696/v2.0/networks -H "User-Agent: openstacksdk/0.8.1 keystoneauth1/2.4.0 python-requests/2.9.1 CPython/2.7.9" -H "Accept: application/json" -H "X-Auth-Token: {SHA1}101a4ea0f64f308aed33412337cc707b4a606752"

In contrast, other services hit the requested endpoint, eg

$ openstack --debug --os-interface internal image list
.
.
.
REQ: curl -g -i --cacert "/etc/ssl/certs/ca-certificates.crt" -X GET https://192.168.245.5:9292/v2/images -H "User-Agent: python-openstackclient keystoneauth1/2.8.0 python-requests/2.10.0 CPython/2.7.9" -H "X-Auth-Token: {SHA1}32e5e13c73c1b8cfd4331cadd3837fef2d7e9ff9"

Changed in python-openstackclient:
assignee: nobody → Stuart McLaren (stuart-mclaren)

Fix proposed to branch: master
Review: https://review.openstack.org/329382

Changed in python-openstackclient:
status: New → In Progress

Reviewed: https://review.openstack.org/329382
Committed: https://git.openstack.org/cgit/openstack/python-openstackclient/commit/?id=7c603e4a67c3d44367afbf2f2f6811d2436295e0
Submitter: Jenkins
Branch: master

commit 7c603e4a67c3d44367afbf2f2f6811d2436295e0
Author: Stuart McLaren <email address hidden>
Date: Tue Jun 14 11:16:12 2016 +0000

    Ensure endpoint type is used for network commands

    Currently OS_ENDPOINT_TYPE and --os-interface are being ignored for
    network commands. This means the public URL is always used.

    Make sure that these are picked up correctly so we hit the correct
    endpoint (internal/admin/etc.) for commands such as:

     $ openstack --os-interface internal network list

    Change-Id: Iac05204e3056e386d84d3644b5da1a2bb322bb0a
    Closes-bug: 1592368

Changed in python-openstackclient:
status: In Progress → Fix Released

Reviewed: https://review.openstack.org/329597
Committed: https://git.openstack.org/cgit/openstack/python-openstackclient/commit/?id=b875f63a6f2a7ac381d4bb80b9c032272126ef49
Submitter: Jenkins
Branch: master

commit b875f63a6f2a7ac381d4bb80b9c032272126ef49
Author: Stuart McLaren <email address hidden>
Date: Tue Jun 14 17:34:22 2016 +0000

    Add release note for network endpoint type bugfix.

    Related-bug: 1592368
    Change-Id: I9bd8c3490e72b32ba48dc9d884c101d5e50867f9

This issue was fixed in the openstack/python-openstackclient 3.0.0 release.

Vasyl Saienko (vsaienko) wrote :

OS_ENDPOINT_TYPE is still ignored

$ pip freeze |grep openstackclient
python-openstackclient==3.9.0

I don't have internal endpoint configured, but "export OS_ENDPOINT_TYPE='internalURL'; openstack network list" shows networks because it uses public endpoint.

$ export OS_ENDPOINT_TYPE='internalURL'; openstack network list
+--------------------------------------+---------+----------------------------------------------------------------------------+
| ID | Name | Subnets |
+--------------------------------------+---------+----------------------------------------------------------------------------+
| d23b3913-80e1-4e8e-9398-a82a060e6b31 | private | 3cdfba83-20b6-410c-98b3-48ce2e8f11ac, e07a6840-7e55-4b8d-ba49-87c101c5851c |
| ff21d45d-4d09-411a-8ebb-dec98f3be2c5 | public | 7da9b97e-e08a-4378-8665-4a649d49880b, d73fc86d-542e-466d-a9b7-85aaa9a3d463 |
+--------------------------------------+---------+----------------------------------------------------------------------------+
$ openstack --os-interface internal network list
internal endpoint for network service in RegionOne region not found
$

Reviewed: https://review.openstack.org/329420
Committed: https://git.openstack.org/cgit/openstack/python-openstackclient/commit/?id=ebf4c7f255347147988e8f1e41f162ade6c2a5ed
Submitter: Jenkins
Branch: stable/mitaka

commit ebf4c7f255347147988e8f1e41f162ade6c2a5ed
Author: Stuart McLaren <email address hidden>
Date: Tue Jun 14 11:16:12 2016 +0000

    Ensure endpoint type is used for network commands

    Currently OS_ENDPOINT_TYPE and --os-interface are being ignored for
    network commands. This means the public URL is always used.

    Make sure that these are picked up correctly so we hit the correct
    endpoint (internal/admin/etc.) for commands such as:

     $ openstack --os-interface internal network list

    Closes-bug: 1592368
    (cherry picked from commit 7c603e4a67c3d44367afbf2f2f6811d2436295e0)
    Change-Id: Iac05204e3056e386d84d3644b5da1a2bb322bb0a

tags: added: in-stable-mitaka
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers