← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1415700] [NEW] Unite the host key(host, host_name)

 

Public bug reported:

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.

** Affects: nova
     Importance: Undecided
     Assignee: tinytmy (tangmeiyan77)
         Status: New

** Changed in: nova
     Assignee: (unassigned) => tinytmy (tangmeiyan77)

** Description changed:

  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)
+   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 host.get(), but lead to host.list() cann't work. 
+ 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.
+ 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.

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1415700

Title:
  Unite the host key(host, host_name)

Status in OpenStack Compute (Nova):
  New

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.

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1415700/+subscriptions


Follow ups

References