When an object attribute has colon in its name, how to use the attribute? The code where I came across this situation is :
instances = nova.servers.list()
for i in instances:
print i.id, i.OS-EXT-SRV-ATTR:hypervisor_hostname
After looking at the link Find All Elements Given Namespaced Attribute and How do I escape a colon in Python format() when using kwargs? I tried using attr as
instances = nova.servers.list()
for i in instances:
print i.id, i.(attr={"OS-EXT-SRV-ATTR":"hypervisor_hostname"})
But it gives error as Invalid syntax. How should I use the attribute OS-EXT-SRV-ATTR:hypervisor_hostname