Mailing List Archive

[xen-unstable] xm list: Return unique exit code for non-existent domain
# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1221730901 -3600
# Node ID 79459028af3991d15ee03d2702a2f4358b1dd8f5
# Parent 104ceb3de2636e12bc177db0143796751dc98678
xm list: Return unique exit code for non-existent domain

This patch will make xm return a exit code of 3 if `xm list
<non_existant_domain>` is done rather than the generic code of 1. I
used 3 because XendClient had a macro setup pointing
ERROR_INVALID_DOMAIN to 3.

From: "Shaun R." <mailinglists@unix-scripts.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
---
tools/python/xen/xm/main.py | 1 +
1 files changed, 1 insertion(+)

diff -r 104ceb3de263 -r 79459028af39 tools/python/xen/xm/main.py
--- a/tools/python/xen/xm/main.py Thu Sep 18 10:39:53 2008 +0100
+++ b/tools/python/xen/xm/main.py Thu Sep 18 10:41:41 2008 +0100
@@ -2926,6 +2926,7 @@ def _run_cmd(cmd, cmd_name, args):
except xmlrpclib.Fault, ex:
if ex.faultCode == XendClient.ERROR_INVALID_DOMAIN:
err("Domain '%s' does not exist." % ex.faultString)
+ return False, ex.faultCode
else:
err(ex.faultString)
_usage(cmd_name)

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xensource.com
http://lists.xensource.com/xen-changelog