Blame SOURCES/bz1214919-fence_scsi-already_on.patch

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