Printing novaclient.v1_1.servers.Server object causes AttributeError
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python-novaclient |
Fix Released
|
Undecided
|
ZhiQiang Fan |
Bug Description
I tried printing a novaclient.v1_1 server object returned by novaclient.
Note: self.clients[
nvlist = self.clients[
for ins in nvlist:
lst = ins.interface_
print type(lst[0])
print lst
This results in:
<class 'novaclient.
Traceback (most recent call last):
File "./collect.py", line 38, in <module>
points = cl.score()
File "/home/
print lst[0]
File "/opt/stack/
return "<Server: %s>" % self.name
File "/opt/stack/
raise AttributeError(k)
AttributeError: name
The issue here is that neither the novaclient.
[['HUMAN_ID', 'NAME_ATTR', '__class__', '__delattr__', '__dict__', '__doc__', '__eq__', '__format__', '__getattr__', '__getattribute__', '__hash__', '__init__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_add_details', '_info', '_loaded', 'add_fixed_ip', 'add_floating_ip', 'add_security_
Possible remedies:
- A name field could be added to base.Resource
- Another way could be used to identify the interface returned, maybe IP or MAC of the interface
- the __repr__ method could be removed entirely if deemed unnecessary
Changed in python-novaclient: | |
milestone: | none → 2.18.0 |
Changed in python-novaclient: | |
status: | Fix Committed → Fix Released |
This needs more information about the version of the client and server used.