[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] xm: Fix xm block-detach error message duplication.



# HG changeset patch
# User Keir Fraser <keir@xxxxxxxxxxxxx>
# Date 1183325127 -3600
# Node ID 5d7160564381eedda0853cf003b3097da0173893
# Parent  7a31e37fec9e222b37aec30e5063ea05c149efcd
xm: Fix xm block-detach error message duplication.
Signed-off-by: Masaki Kanno <kanno.masaki@xxxxxxxxxxxxxx>
---
 tools/python/xen/xm/main.py |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff -r 7a31e37fec9e -r 5d7160564381 tools/python/xen/xm/main.py
--- a/tools/python/xen/xm/main.py       Sun Jul 01 22:23:16 2007 +0100
+++ b/tools/python/xen/xm/main.py       Sun Jul 01 22:25:27 2007 +0100
@@ -2168,9 +2168,7 @@ def xm_network_attach(args):
         server.xend.domain.device_create(dom, vif)
 
 
-def detach(args, command, deviceClass):
-    arg_check(args, command, 2, 3)
-
+def detach(args, deviceClass):
     dom = args[0]
     dev = args[1]
     try:
@@ -2204,12 +2202,13 @@ def xm_block_detach(args):
             raise OptionError("Cannot find device '%s' in domain '%s'"
                               % (dev,dom))
     else:
+        arg_check(args, 'block-detach', 2, 3)
         try:
-            detach(args, 'block-detach', 'vbd')
+            detach(args, 'vbd')
             return
         except:
             pass
-        detach(args, 'block-detach', 'tap')
+        detach(args, 'tap')
 
 def xm_network_detach(args):
     if serverType == SERVER_XEN_API:
@@ -2227,7 +2226,8 @@ def xm_network_detach(args):
         else:
             print "Cannot find device '%s' in domain '%s'" % (devid,dom)
     else:
-        detach(args, 'network-detach', 'vif')
+        arg_check(args, 'network-detach', 2, 3)
+        detach(args, 'vif')
 
 
 def xm_vnet_list(args):

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.