summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDominique Martinet <asmadeus@codewreck.org>2012-08-23 13:25:58 +0200
committerDominique Martinet <asmadeus@codewreck.org>2012-08-23 13:25:58 +0200
commit23c14d5164dadfe3c9a2dd294212389c45dd2863 (patch)
tree168558c135e97c38bb3750cdff6e80ebee8bbc20
parentdd2dc461ee2091caed4f0b9edeb4b7595c86c12e (diff)
added check for descriptor creation rights in create-desc
-rwxr-xr-xkvm-wrapper.sh3
1 files changed, 2 insertions, 1 deletions
diff --git a/kvm-wrapper.sh b/kvm-wrapper.sh
index c8dac7d..39803f2 100755
--- a/kvm-wrapper.sh
+++ b/kvm-wrapper.sh
@@ -644,9 +644,10 @@ function kvm_create_descriptor ()
VM_NAME="$1"
VM_DESCRIPTOR="$VM_DIR/$VM_NAME-vm"
- test_exist "$VM_DESCRIPTOR" && fail_exit "Error : $VM_NAME already exists ($VM_DESCRIPTOR found)"
+ test_exist "$VM_DESCRIPTOR" && fail_exit "Error: $VM_NAME already exists ($VM_DESCRIPTOR found)"
touch "$VM_DESCRIPTOR"
+ test_exist "$VM_DESCRIPTOR" || fail_exit "Error: Could not create $VM_NAME descriptor ($VM_DSECRIPTOR)"
echo "# VM $VM_NAME file descriptor" >> "$VM_DESCRIPTOR"
echo "# Created : `date` on $HOSTNAME by $USER" >> "$VM_DESCRIPTOR"
echo "" >> "$VM_DESCRIPTOR"