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
It used host_name key in /github. com/openstack/ nova/blob/ master/ nova/api/ openstack/ compute/ contrib/ hosts.py# L40 /github. com/openstack/ nova/blob/ master/ nova/api/ openstack/ compute/ contrib/ hosts.py# L266-L267
https:/
used host key in
https:/
Why not unite the key.
And this lead to novaclient bug such as: Client( "admin" ,"password" ,"admin" ,"http:// 192.168. 1.100:5000/ v2.0") get("controller ")
>>> from novaclient.v1_1 import client
>>> nc = client.
>>> nc.hosts.
[<Host: controller>, <Host: controller>, <Host: controller>, <Host: controller>]
>>> nc.hosts.list() python2. 7/dist- packages/ novaclient/ v1_1/hosts. py", line 24, in __repr__ python2. 7/dist- packages/ novaclient/ openstack/ common/ apiclient/ base.py" , line 489, in __getattr__
[Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/
return "<Host: %s>" % self.host
File "/usr/lib/
raise AttributeError(k)
AttributeError: host
------- ------- ------- ------- ------- /review. openstack. org/#/c/ 110087/, /github. com/openstack/ python- novaclient/ blob/master/ novaclient/ v1_1/hosts. py#L24,
Maybe some people think it is the novaclient bug.
In this patch https:/
it fix the host.get(), but lead to host.list() cann't work.
Maybe we can add some judge such as(if .eg) in the function of
https:/
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.