Unite the host key(host, host_name)

Bug #1415700 reported by tinytmy
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Confirmed
Low
Unassigned
tempest
Invalid
Undecided
tinytmy

Bug Description

It used host_name key in
https://github.com/openstack/nova/blob/master/nova/api/openstack/compute/contrib/hosts.py#L40
used host key in
https://github.com/openstack/nova/blob/master/nova/api/openstack/compute/contrib/hosts.py#L266-L267
Why not unite the key.

And this lead to novaclient bug such as:
>>> from novaclient.v1_1 import client
>>> nc = client.Client("admin","password","admin","http://192.168.1.100:5000/v2.0")
>>> nc.hosts.get("controller")
[<Host: controller>, <Host: controller>, <Host: controller>, <Host: controller>]

>>> nc.hosts.list()
[Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/dist-packages/novaclient/v1_1/hosts.py", line 24, in __repr__
    return "<Host: %s>" % self.host
  File "/usr/lib/python2.7/dist-packages/novaclient/openstack/common/apiclient/base.py", line 489, in __getattr__
    raise AttributeError(k)
AttributeError: host

-----------------------------------
Maybe some people think it is the novaclient bug.
In this patch https://review.openstack.org/#/c/110087/,
it fix the hosts.get(), but lead to hosts.list() cann't work.
Maybe we can add some judge such as(if .eg) in the function of
https://github.com/openstack/python-novaclient/blob/master/novaclient/v1_1/hosts.py#L24,
but I think unite the key to 'host' in nova is much better, if such we don't need to change novaclient and nova code looks better.

tinytmy (tangmeiyan77)
Changed in nova:
assignee: nobody → tinytmy (tangmeiyan77)
description: updated
Changed in nova:
importance: Undecided → Low
status: New → Confirmed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

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

Changed in nova:
status: Confirmed → In Progress
tinytmy (tangmeiyan77)
Changed in tempest:
assignee: nobody → tinytmy (tangmeiyan77)
Revision history for this message
Ghanshyam Mann (ghanshyammann) wrote :

So this is backward incompatible change for Nova. I think, It needs to go through micro-version without breaking V2 API compatibility .

Currently Tempest do not tests API micro-version (as there is no candidate till now) if proposed nova changes is accepted for micro-version then we need to decide how to test microversion in tempest.

Current tempest tests are right/valid to maintain the backward compatibility of Nova API.

Revision history for this message
Ghanshyam Mann (ghanshyammann) wrote :

Marking incomplete for tempest till it is decided in Nova first.

Changed in tempest:
status: New → Incomplete
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on nova (master)

Change abandoned by Joe Gordon (<email address hidden>) on branch: master
Review: https://review.openstack.org/152416
Reason: This review is > 4 weeks without comment, and failed Jenkins the last time it was checked. We are abandoning this for now. Feel free to reactivate the review by pressing the restore button and leaving a 'recheck' comment to get fresh test results.

Changed in nova:
assignee: tinytmy (tangmeiyan77) → nobody
status: In Progress → Confirmed
Revision history for this message
Ken'ichi Ohmichi (oomichi) wrote :

Nova team has decided the corresponding patch is not necessary, so we don't need to fix this also on Tempest side because of non-activity in long-term also.

Changed in tempest:
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.