From d70b3058942f85c3dd8c892de40a676331257fcb Mon Sep 17 00:00:00 2001
From: Iustin Pop <iustin@google.com>
Date: Mon, 27 Oct 2008 23:19:22 +0000
Subject: [PATCH] Change exit code of gnt-backup list

Currently gnt-backup list exits with the same error code even if can't
contact som nodes for backup information.

The patch changes it to return 1 instead in this case.

Reviewed-by: imsnah
---
 scripts/gnt-backup | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/scripts/gnt-backup b/scripts/gnt-backup
index fd7b18a0c..77c1fcb4f 100755
--- a/scripts/gnt-backup
+++ b/scripts/gnt-backup
@@ -45,6 +45,7 @@ def PrintExportList(opts, args):
 
   """
   exports = GetClient().QueryExports(opts.nodes)
+  retcode = 0
   for node in exports:
     ToStdout("Node: %s", node)
     ToStdout("Exports:")
@@ -53,6 +54,8 @@ def PrintExportList(opts, args):
         ToStdout("\t%s", instance_name)
     else:
       ToStdout("  Could not get exports list")
+      retcode = 1
+  return retcode
 
 
 def ExportInstance(opts, args):
-- 
GitLab