Gitweb:
http://git.fedorahosted.org/git/fence-agents.git?p=fence-agents.git;a=com...
Commit: 0144619d57737bd8eba90e6b6c6b5f2bbb45247c
Parent: 2be096c234ea7f4592c36759ba965a0f2c1879dc
Author: Marek 'marx' Grac <mgrac(a)redhat.com>
AuthorDate: Mon Apr 4 14:43:36 2011 +0200
Committer: Marek 'marx' Grac <mgrac(a)redhat.com>
CommitterDate: Mon Apr 4 14:43:36 2011 +0200
library: Add support for UUID (-U / --uuid / uuid)
Fence agents can use --uuid as a replacement for --port. This is very
useful in a case of virtual machines that have both UUID and name.
Patch proposed by Matt Clark
---
fence/agents/lib/fencing.py.py | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/fence/agents/lib/fencing.py.py b/fence/agents/lib/fencing.py.py
index 8bd6f45..32b5d2b 100644
--- a/fence/agents/lib/fencing.py.py
+++ b/fence/agents/lib/fencing.py.py
@@ -386,7 +386,14 @@ all_opt = {
"default" : "1",
"required" : "0",
"shortdesc" : "Count of attempts to retry power on",
- "order" : 201 }
+ "order" : 201 },
+ "uuid" : {
+ "getopt" : "U:",
+ "longopt" : "uuid",
+ "help" : "-U, --uuid UUID of the VM to
fence.",
+ "required" : "0",
+ "shortdesc" : "The UUID of the virtual machine to fence.",
+ "order" : 1}
}
common_opt = [ "retry_on", "delay" ]
@@ -687,7 +694,7 @@ def check_input(device_opt, opt):
if 0 == os.path.isfile(options["-k"]):
fail_usage("Failed: Identity file " + options["-k"] + " does
not exist")
- if (0 == ["list", "monitor"].count(options["-o"].lower()))
and (0 == options.has_key("-n")) and (device_opt.count("port")):
+ if (0 == ["list", "monitor"].count(options["-o"].lower()))
and (0 == options.has_key("-n") and 0 == options.has_key("-U")) and
(device_opt.count("port")):
fail_usage("Failed: You have to enter plug number")
if options.has_key("-S"):