From d792fe4f587dda5e53977daaf0d3a1c1eca322dd Mon Sep 17 00:00:00 2001 From: Guido Trotter Date: Mon, 28 Jan 2008 09:43:38 +0000 Subject: [PATCH] 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: iustinp --- scripts/gnt-backup | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/gnt-backup b/scripts/gnt-backup index 660cb61..e908498 100755 --- a/scripts/gnt-backup +++ b/scripts/gnt-backup @@ -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): -- 1.7.10.4