Skip to content
Snippets Groups Projects
Commit 461f0538 authored by Guido Trotter's avatar Guido Trotter
Browse files

Check that we have a valid export list

Before iterating over the list of exports present on a node, check that what
ganeti returned is actually a list. This solves the case when one of the nodes
is down, and an error value is returned.

This fixes issue 21

Reviewed-by: imsnah
parent d87ae7d2
No related branches found
No related tags found
No related merge requests found
...@@ -43,8 +43,11 @@ def PrintExportList(opts, args): ...@@ -43,8 +43,11 @@ def PrintExportList(opts, args):
for node in exports: for node in exports:
print ("Node: %s" % node) print ("Node: %s" % node)
print ("Exports:") print ("Exports:")
for instance_name in exports[node]: if isinstance(exports[node], list):
print ("\t%s" % instance_name) for instance_name in exports[node]:
print ("\t%s" % instance_name)
else:
print (" Could not get exports list")
def ExportInstance(opts, args): def ExportInstance(opts, args):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment