Blob Blame History Raw
From a22d964c8a4d21fa3cca5f4b8e284319d77c4779 Mon Sep 17 00:00:00 2001
From: Marek 'marx' Grac <mgrac@redhat.com>
Date: Mon, 27 Jul 2015 11:02:31 +0200
Subject: [PATCH] fencing: If --port-as-ip is used then monitor action should
 be 'status', not 'list'

Resolves: rhbz#1390915
---
 fence/agents/lib/fencing.py.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/fence/agents/lib/fencing.py.py b/fence/agents/lib/fencing.py.py
index 1cc1eb0..8fa81c7 100644
--- a/fence/agents/lib/fencing.py.py
+++ b/fence/agents/lib/fencing.py.py
@@ -940,8 +940,9 @@ def fence_action(tn, options, set_power_fn, get_power_fn, get_outlet_list=None,
 
 		## Process options that manipulate fencing device
 		#####
-		if options["--action"] in ["list", "list-status"] or \
-			((options["--action"] == "monitor") and 1 == options["device_opt"].count("port")):
+		if (options["--action"] in ["list", "list-status"]) or \
+			((options["--action"] == "monitor") and 1 == options["device_opt"].count("port") and \
+			0 == options["device_opt"].count("port_as_ip")):
 
 			if 0 == options["device_opt"].count("port"):
 				print "N/A"
-- 
2.4.11