|
|
|
|
|
|
|
|
|
|
xen-api
[Xen-API] [PATCH] Some minor improvements to the with-vdi script
- 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}
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 <=
|
|
|
|
|