简体   繁体   中英

how to extract values from <bound method Server.diagnostics of <Server: ubuntu12_6>>?

I'm using novaclient.v1_1 to get list of instances and trying to extract diagnostics of each server instance.

code i've written

instances = nova.servers.list()
  for i in instances:
    val_list = i.diagnostics
    print val_list

so here i got output like this

<bound method Server.diagnostics of <Server: ubuntu12_6>>
<bound method Server.diagnostics of <Server: ubuntu12_4>>
<bound method Server.diagnostics of <Server: ubuntu12_3>>
<bound method Server.diagnostics of <Server: ubuntu12_1>>

so how can i get full diagnostics information of each server instance?? how to extract tap interface info from this object?

As the output says, diagnostics is a method . That means you need to call it!

instances = nova.servers.list()
  for i in instances:
    val_list = i.diagnostics()     # <---- Add parenthesis here
    print val_list

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM