WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-api

[Xen-API] [PATCH] Some minor improvements to the with-vdi script

To: xen-api@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-API] [PATCH] Some minor improvements to the with-vdi script
From: Zheng Li <dev@xxxxxxxx>
Date: Wed, 16 Jun 2010 15:30:42 -0000
Delivery-date: Wed, 16 Jun 2010 08:32:01 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-api-request@lists.xensource.com?subject=help>
List-id: Discussion of API issues surrounding Xen <xen-api.lists.xensource.com>
List-post: <mailto:xen-api@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-api-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mercurial-patchbomb/1.3.1
- return the user command's exit code as the exit code of with-vdi script 
(unless something else failed in the preparation or post run steps)
- relax the requirement on the user command parameter, both absolute paths and 
in-paths executables are acceptable
- allow a user command to have its own arguments (i.e. with-vdi vdi-uuid 
user-command arg1 arg2 ... argn)

Signed-off-by: Zheng Li <dev@xxxxxxxx>


 scripts/with-vdi |  10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)


diff -r c0e27f018867 -r a6596df3debe scripts/with-vdi
--- a/scripts/with-vdi  Tue May 04 07:18:23 2010 +0100
+++ b/scripts/with-vdi  Wed Jun 16 16:26:42 2010 +0100
@@ -18,14 +18,17 @@
   usage
   exit 1
 fi
+
 COMMAND=$2
 if [ -z "$COMMAND" ]; then
   COMMAND=/bin/sh
-fi
-if [ ! -x "$COMMAND" ]; then
+elif ! which "$COMMAND" > /dev/null ; then
   echo Failed to find command: ${COMMAND}
   usage
   exit 1
+else
+  shift 1
+  COMMAND=$*
 fi
 
 . /etc/xensource-inventory
@@ -41,6 +44,7 @@
 export DEVICE
 echo DEVICE=${DEVICE}
 ${COMMAND}
+RC=$?
 xe vbd-unplug uuid=${VBD}
 xe vbd-destroy uuid=${VBD}
-
+exit ${RC}

Attachment: xen-api.patch
Description: Text Data

_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-API] [PATCH] Some minor improvements to the with-vdi script, Zheng Li <=