Controller: print all agents info
Change-Id: I181da3b91a38aa64609fa7537d3f4d6d32b35f53
This commit is contained in:
parent
283008d51f
commit
2bc7b90781
@ -265,3 +265,31 @@ class CheckVlanInterface(Lister):
|
||||
return (('Destination', 'Packet Loss (%)'),
|
||||
((k, v) for k, v in res['data'].items()))
|
||||
return (['Error Mssage', ' '], [('message', res['message'])])
|
||||
|
||||
|
||||
class PrintAgentsInfo(Lister):
|
||||
"""Print all agents info."""
|
||||
|
||||
def get_parser(self, prog_name):
|
||||
parser = super(PrintAgentsInfo, self).get_parser(prog_name)
|
||||
return parser
|
||||
|
||||
def take_action(self, parsed_args):
|
||||
try:
|
||||
from steth.stethclient.constants import MGMT_AGENTS_INFOS
|
||||
from steth.stethclient.constants import NET_AGENTS_INFOS
|
||||
from steth.stethclient.constants import STORAGE_AGENTS_INFOS
|
||||
except Exception as e:
|
||||
Logger.log_fail("Import configure file fail. Because: %s!" % e)
|
||||
sys.exit()
|
||||
|
||||
results = []
|
||||
for agent in MGMT_AGENTS_INFOS.keys():
|
||||
r = []
|
||||
r.append(agent)
|
||||
r.append(MGMT_AGENTS_INFOS[agent])
|
||||
r.append(NET_AGENTS_INFOS[agent])
|
||||
r.append(STORAGE_AGENTS_INFOS[agent])
|
||||
results.append(r)
|
||||
return (('Agent Name', 'Management IP', 'Network IP', 'Storage IP'),
|
||||
results)
|
||||
|
@ -39,6 +39,7 @@ COMMAND_V1 = {
|
||||
'check-vlan-interface': agent_api.CheckVlanInterface,
|
||||
'check-iperf': iperf_api.CheckIperf,
|
||||
'check-dhcp-on-comp': dhcp.CheckDHCPonComputeNodes,
|
||||
'print-agents-info': agent_api.PrintAgentsInfo,
|
||||
}
|
||||
|
||||
COMMANDS = {'0.1': COMMAND_V1}
|
||||
|
Loading…
x
Reference in New Issue
Block a user