resource-agents: master - resource-agents: Report bad config from vm.sh

Lon Hohberger lon at fedoraproject.org
Tue Nov 3 17:15:08 UTC 2009


Gitweb:        http://git.fedorahosted.org/git/resource-agents.git?p=resource-agents.git;a=commitdiff;h=becbaff82799a2327f696231f614ca1c4c6be1a0
Commit:        becbaff82799a2327f696231f614ca1c4c6be1a0
Parent:        bf230b3eb1cc4576a001ce173704c398a3f3cef6
Author:        Lon Hohberger <lhh at redhat.com>
AuthorDate:    Fri Oct 30 17:23:03 2009 -0400
Committer:     Lon Hohberger <lhh at redhat.com>
CommitterDate: Tue Nov 3 12:14:24 2009 -0500

resource-agents: Report bad config from vm.sh

Resolves: rhbz#529926

Signed-off-by: Lon Hohberger <lhh at redhat.com>
---
 rgmanager/src/resources/vm.sh |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/rgmanager/src/resources/vm.sh b/rgmanager/src/resources/vm.sh
index 4113a50..fd62747 100644
--- a/rgmanager/src/resources/vm.sh
+++ b/rgmanager/src/resources/vm.sh
@@ -600,11 +600,24 @@ validate_all()
 			echo "Management tool: virsh"
 			export OCF_RESKEY_use_virsh=1
 		else
+			if [ "$OCF_RESKEY_hypervisor" != "xen" ]; then
+				ocf_log err "Cannot use $OCF_RESKEY_hypervisor hypervisor with 'path' attribute"
+				return $OCF_ERR_ARGS
+			fi
+				
 			echo "Management tool: xm"
 			export OCF_RESKEY_use_virsh=0
 		fi
 	fi
 
+	if [ "$OCF_RESKEY_use_virsh" = "0" ]; then
+		if [ "$OCF_RESKEY_hypervisor" = "qemu" ] ||
+		   [ "$OCF_RESKEY_hypervisor" = "kvm" ]; then
+			ocf_log err "Cannot use $OCF_RESKEY_hypervisor hypervisor without using virsh"
+			return $OCF_ERR_ARGS
+		fi
+	fi
+
 	#
 	# Set the hypervisor URI
 	#


More information about the cluster-commits mailing list