xm, xenapi: Fix a problem in xm client for domain shutdown
authorKeir Fraser <keir.fraser@citrix.com>
Wed, 30 Jul 2008 08:23:11 +0000 (09:23 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Wed, 30 Jul 2008 08:23:11 +0000 (09:23 +0100)
Xm did not shut down domains anymore when run in xen-api mode due to a
'None' parameter being passed to xend when looking up a domain. This
fixes the problem.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
tools/python/xen/xm/shutdown.py

index 2e6294a979285a486dcbebb575284395b1bc2123..125dcc1e8091a11446fb5f364ea4f484c19310e4 100644 (file)
@@ -144,9 +144,10 @@ def main_all(opts, args):
 def main_dom(opts, args):
     if len(args) == 0: opts.err('No domain parameter given')
     if len(args) >  1: opts.err('No multiple domain parameters allowed')
-    dom = sxp.child_value(server.xend.domain(args[0]), 'name')
     if serverType == SERVER_XEN_API:
-        dom = get_single_vm(dom)
+        dom = get_single_vm(args[0])
+    else:
+        dom = sxp.child_value(server.xend.domain(args[0]), 'name')
     mode = shutdown_mode(opts)  
     shutdown(opts, [ dom ], mode, opts.vals.wait)