Skip to contentSkip to conversation

fencing: added option "on_target"

PATCH New Ondrej Mular 1 participant 1 message May 2, 2014 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/3 fencing: added option "on_target"

added option "on_target" for agents that need attribute "on_target" in metadata

---
 fence/agents/lib/fencing.py.py | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
fence/agents/lib/fencing.py.py +8 -1
index 0539a2f..76c2cd1 100644
@@ -370,6 +370,10 @@ all_opt = {
 		"shortdesc" : "Method to fence (onoff|cycle)",
 		"default" : "onoff",
 		"choices" : [ "onoff", "cycle" ],
+		"order" : 1},
+	"on_target": {
+		"getopt" : "",
+		"help" : "",
 		"order" : 1}
 }
 
@@ -521,7 +525,10 @@ def metadata(avail_opt, options, docs):
 	print "<actions>"
 	if avail_opt.count("fabric_fencing") == 1:
 		## do 'unfence' at the start
-		print "\t<action name=\"on\" automatic=\"1\"/>"
+		if avail_opt.count("on_target") == 1:
+			print "\t<action name=\"on\" on_target=\"1\" automatic=\"1\"/>"
+		else:
+			print "\t<action name=\"on\" automatic=\"1\"/>"
 	else:
 		print "\t<action name=\"on\" automatic=\"0\"/>"
 	print "\t<action name=\"off\" />"
Signature · 1 line
1.8.3.1