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
......@@ -43,8 +43,11 @@ def PrintExportList(opts, args):
for node in exports:
print ("Node: %s" % node)
print ("Exports:")
for instance_name in exports[node]:
print ("\t%s" % instance_name)
if isinstance(exports[node], list):
for instance_name in exports[node]:
print ("\t%s" % instance_name)
else:
print (" Could not get exports list")
def ExportInstance(opts, args):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment