summaryrefslogtreecommitdiff
path: root/cxmanage_api/cli/commands/fabric.py
diff options
context:
space:
mode:
Diffstat (limited to 'cxmanage_api/cli/commands/fabric.py')
-rw-r--r--cxmanage_api/cli/commands/fabric.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/cxmanage_api/cli/commands/fabric.py b/cxmanage_api/cli/commands/fabric.py
index a47c5f3..3f4d4f6 100644
--- a/cxmanage_api/cli/commands/fabric.py
+++ b/cxmanage_api/cli/commands/fabric.py
@@ -156,3 +156,28 @@ def uplinks_command(args):
print "Some errors occured during the command.\n"
return len(errors) == 0
+
+
+def networks_command(args):
+ """get networks from nodes"""
+ args.all_nodes = False
+
+ tftp = get_tftp(args)
+ nodes = get_nodes(args, tftp)
+
+ if not args.quiet:
+ print "Getting networks..."
+ results, errors = run_command(
+ args, nodes, "run_fabric_tftp_command", "fabric_config_get_networks"
+ )
+
+ for node in nodes:
+ if node in results:
+ print "[ Networks from %s ]" % node.ip_address
+ print results[node].strip()
+ print
+
+ if not args.quiet and errors:
+ print "Some errors occured during the command.\n"
+
+ return len(errors) == 0