简体   繁体   English

如何从中提取值 <bound method Server.diagnostics of <Server: ubuntu12_6> &gt;?

[英]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. 我正在使用novaclient.v1_1获取实例列表,并尝试提取每个服务器实例的诊断信息。

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? 如何从此对象中提取Tap界面信息?

As the output says, diagnostics is a method . 如输出所示, diagnostics是一种方法 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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何从Ubuntu连接到Windows SQL Server - How to connect to windows SQL Server from Ubuntu 如何从ubuntu服务器以编程方式登录到Yahoo - how to login to Yahoo programatically from an ubuntu server 如何从从 ntp 服务器获取的时间中提取秒数 - How to extract seconds from time taken from ntp server 如何使用python Ubuntu从远程服务器读取Excel文件 - How to read excel file from remote server using python ubuntu 如何使用sqlalchemy从ubuntu连接远程Windows MSSQL服务器 - how to connect remote windows MSSQL server from ubuntu using sqlalchemy 如何从 DNS Python 响应中提取 SOA DNS 服务器 - How to extract the SOA DNS Server from a DNS Python Response 如何从 bigquery 中提取 csv 并将其发送到具有 python 的外部服务器? - How to extract a csv from bigquery and send it to an external server with python? 从ubuntu服务器执行/运行python脚本 - Executing / Running a python script from ubuntu server 从 Windows 访问 VM 中的 Ubuntu django 服务器 - Access Ubuntu django server in VM from Windows 绑定到辅助IP的Python扩展坞从服务器获取连接重置 - Python socked bound to secondary IP gets connection reset from server
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM