Gitweb:
http://git.fedorahosted.org/git/?p=fence-agents.git;a=commitdiff;h=d7378e...
Commit: d7378e8c4b986fa490b31d53526edf24c6b0c9e1
Parent: 8900e3ed1446a8b882cc6eed7fd3595b0f4d3ffb
Author: Marek 'marx' Grac <mgrac(a)redhat.com>
AuthorDate: Fri Jun 7 10:05:17 2013 +0200
Committer: Marek 'marx' Grac <mgrac(a)redhat.com>
CommitterDate: Fri Jun 7 10:10:06 2013 +0200
fencing: Action 'monitor' is not working properly for fence agents without
'--plugs'
The bug was introduced when support for multiple ports was added.
commit 0097e806545d722270b739f31a754d65994b18c9
---
fence/agents/lib/fencing.py.py | 27 +++++++++++++++------------
1 files changed, 15 insertions(+), 12 deletions(-)
diff --git a/fence/agents/lib/fencing.py.py b/fence/agents/lib/fencing.py.py
index b7ea3d9..1424111 100644
--- a/fence/agents/lib/fencing.py.py
+++ b/fence/agents/lib/fencing.py.py
@@ -731,18 +731,21 @@ def wait_power_status(tn, options, get_power_fn):
def get_multi_power_fn(tn, options, get_power_fn):
status = "off"
- for plug in options["--plugs"]:
- try:
- options["--uuid"] = str(uuid.UUID(plug))
- except ValueError:
- pass
- except KeyError:
- pass
+ if options.has_key("--plugs"):
+ for plug in options["--plugs"]:
+ try:
+ options["--uuid"] = str(uuid.UUID(plug))
+ except ValueError:
+ pass
+ except KeyError:
+ pass
- options["--plug"] = plug
- plug_status = get_power_fn(tn, options)
- if plug_status == "on":
- status = plug_status
+ options["--plug"] = plug
+ plug_status = get_power_fn(tn, options)
+ if plug_status == "on":
+ status = plug_status
+ else:
+ status = get_power_fn(tn, options)
return status