Blame SOURCES/bz1214919-fence_scsi-already_on.patch

e4ffb1
From 4e338b93999996f9eae873d7aab84ef30dd0688e Mon Sep 17 00:00:00 2001
e4ffb1
From: Marek 'marx' Grac <mgrac@redhat.com>
e4ffb1
Date: Wed, 17 Jun 2015 19:40:11 +0200
e4ffb1
Subject: [PATCH 03/10] fence_scsi: Status report "off" if any device is off
e4ffb1
 during "on" action
e4ffb1
e4ffb1
We need status to report "on" if any device is on most of the time so
e4ffb1
that stonith or other entities can know if a host is capable of
e4ffb1
accessing shared resources, but during an "on" action this is
e4ffb1
problematic because even if some devices are off, we will skip turning
e4ffb1
them on since we reported the status as on.  This changes the behavior
e4ffb1
to report "off" if any device is off, but only during "on" actions.
e4ffb1
e4ffb1
Resolves: rhbz#1214919
e4ffb1
---
e4ffb1
 fence/agents/scsi/fence_scsi.py | 3 +++
e4ffb1
 1 file changed, 3 insertions(+)
e4ffb1
e4ffb1
diff --git a/fence/agents/scsi/fence_scsi.py b/fence/agents/scsi/fence_scsi.py
e4ffb1
index de301a5..f373e6b 100644
e4ffb1
--- a/fence/agents/scsi/fence_scsi.py
e4ffb1
+++ b/fence/agents/scsi/fence_scsi.py
e4ffb1
@@ -32,6 +32,9 @@ def get_status(conn, options):
e4ffb1
 		else:
e4ffb1
 			logging.debug("No registration for key "\
e4ffb1
 				+ options["--key"] + " on device " + dev + "\n")
e4ffb1
+			if options["--action"] == "on":
e4ffb1
+				status = "off"
e4ffb1
+				break
e4ffb1
 	return status
e4ffb1
 
e4ffb1
 
e4ffb1
-- 
e4ffb1
1.9.3
e4ffb1