Client does not respect OS_REGION_NAME (or --os-region-name)

Bug #1254168 reported by Lars Kellogg-Stedman
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
python-openstackclient
Invalid
Medium
Terry Howe

Bug Description

The "openstack" command does not appear to respect OS_REGION_NAME. I have compute services in two regions; the default ("RegionOne") and another called "Havana". The "nova" command line client behaves like this when OS_REGION_NAME is unspecified:

    $ nova list
    ERROR: AmbiguousEndpoints: [{u'adminURL': u'http://192.168.122.110:8774/v2/a4c4f915bf024710a1203f207aa3e4d3', u'region': u'RegionOne', u'id': u'300d2fbe3817458fb6be4d2d615b5edb', 'serviceName': u'nova', u'internalURL': u'http://192.168.122.110:8774/v2/a4c4f915bf024710a1203f207aa3e4d3', u'publicURL': u'http://192.168.122.110:8774/v2/a4c4f915bf024710a1203f207aa3e4d3'}, {u'adminURL': u'http://192.168.122.198:8774/v2/a4c4f915bf024710a1203f207aa3e4d3', u'region': u'Havana', u'id': u'598415ff5375421fb417744c54a3276b', 'serviceName': u'nova', u'internalURL': u'http://192.168.122.198:8774/v2/a4c4f915bf024710a1203f207aa3e4d3', u'publicURL': u'http://192.168.122.198:8774/v2/a4c4f915bf024710a1203f207aa3e4d3'}]

And like this with "--os-region-name RegionOne":

    $ nova --os-region-name RegionOne

And with "--os-region-name Havana":

    $ nova --os-region-name Havana list
    +--------------------------------------+-------+--------+------------+-------------+----------------------------------+
    | ID | Name | Status | Task State | Power State | Networks |
    +--------------------------------------+-------+--------+------------+-------------+----------------------------------+
    | 8a38cce2-4095-4937-a649-c9ff8cddfbdb | test0 | ACTIVE | None | Running | private-0=10.0.0.2 |
    | 80b03cba-d92a-4621-93de-0449f0a0fa02 | test1 | ACTIVE | None | Running | private-0=10.0.0.4, 172.24.4.227 |
    +--------------------------------------+-------+--------+------------+-------------+----------------------------------+

On the other hand, the "openstack" command always seems to reference
"RegionOne", and ignores a region set either on the command line or as
an environment variable.

With no explicit region:

    $ openstack -q server list

With "--os-region-name Havana":

    $ openstack -q --os-region-name Havana server list

With "OS_REGION_NAME=Havana":

    $ OS_REGION_NAME=Havana openstack -q server list

For reference:

    $ openstack -q endpoint list
    +----------------------------------+-----------+--------------+--------------+
    | ID | Region | Service Name | Service Type |
    +----------------------------------+-----------+--------------+--------------+
    | ba686936d31846f5b226539dba285654 | RegionOne | quantum | network |
    | 0ca1540962704a01aba5c18f96cfa1d6 | Havana | cinder | volume |
    | 161684fd123740138c8806267c489766 | RegionOne | cinder | volume |
    | b2019dbef5f34d1bb809e8e399369782 | RegionOne | keystone | identity |
    | c056f37b057b4c62b493bff4452f8559 | Havana | nova | compute |
    | 4b5dd8c6b961442ba13d6b9d317d718a | RegionOne | swift_s3 | s3 |
    | ac766707ffa3437eaaeaafa3c3eace08 | RegionOne | swift | object-store |
    | e3f7bd37b51341bbaa77f81ba39a3bf2 | RegionOne | glance | image |
    | 6821fad71a914636af6e98775e52e1ec | RegionOne | nova_ec2 | ec2 |
    | 3b2a90e9f85a468988af763c707961d7 | RegionOne | nova | compute |
    +----------------------------------+-----------+--------------+--------------+

Dean Troyer (dtroyer)
Changed in python-openstackclient:
importance: Undecided → Medium
milestone: none → m2
Revision history for this message
Terry Howe (thowe-g) wrote :

Was this problem fixed somehow? I cannot reproduce.

(.venv)terry@brat:~/hp/python-openstackclient$ os server list --os-region region-a.geo-1
WARNING: keystoneclient.httpclient Failed to retrieve management_url from token
+--------------------------------------+---------+--------+-----------------+
| ID | Name | Status | Networks |
+--------------------------------------+---------+--------+-----------------+
| 2c1e19a2-4a6b-4dd1-96cd-3a2b77202e5b | swerver | ACTIVE | oscaft=10.2.1.3 |
+--------------------------------------+---------+--------+-----------------+
(.venv)terry@brat:~/hp/python-openstackclient$ os server list --os-region region-b.geo-1
WARNING: keystoneclient.httpclient Failed to retrieve management_url from token
+--------------------------------------+-------+--------+------------------------------+
| ID | Name | Status | Networks |
+--------------------------------------+-------+--------+------------------------------+
| 2c08f094-edde-46b3-aaec-b4124551b289 | servb | ACTIVE | terrylhowe-network=10.0.0.27 |
| 328b75bd-0a3e-4e28-9438-18f4d5541e86 | servo | ACTIVE | terrylhowe-network=10.0.0.26 |
+--------------------------------------+-------+--------+------------------------------+
(.venv)terry@brat:~/hp/python-openstackclient$ export OS_REGION_NAME=region-b.geo-1
(.venv)terry@brat:~/hp/python-openstackclient$ os server list
WARNING: keystoneclient.httpclient Failed to retrieve management_url from token
+--------------------------------------+-------+--------+------------------------------+
| ID | Name | Status | Networks |
+--------------------------------------+-------+--------+------------------------------+
| 2c08f094-edde-46b3-aaec-b4124551b289 | servb | ACTIVE | terrylhowe-network=10.0.0.27 |
| 328b75bd-0a3e-4e28-9438-18f4d5541e86 | servo | ACTIVE | terrylhowe-network=10.0.0.26 |
+--------------------------------------+-------+--------+------------------------------+
(.venv)terry@brat:~/hp/python-openstackclient$ export OS_REGION_NAME=region-a.geo-1
(.venv)terry@brat:~/hp/python-openstackclient$ os server list
WARNING: keystoneclient.httpclient Failed to retrieve management_url from token
+--------------------------------------+---------+--------+-----------------+
| ID | Name | Status | Networks |
+--------------------------------------+---------+--------+-----------------+
| 2c1e19a2-4a6b-4dd1-96cd-3a2b77202e5b | swerver | ACTIVE | oscaft=10.2.1.3 |
+--------------------------------------+---------+--------+-----------------+
(.venv)terry@brat:~/hp/python-openstackclient$

Terry Howe (thowe-g)
Changed in python-openstackclient:
status: New → Incomplete
assignee: nobody → Terry Howe (thowe-g)
Revision history for this message
Terry Howe (thowe-g) wrote :

I'm assuming fixed at some point. Reopen if you can reproduce.

Changed in python-openstackclient:
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.