Re: [PATCH 5/5] prevent getting started up or shutdown again while already in such state

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Essential with all the correct error handling in place.
---
 storage/zfcp.py |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/storage/zfcp.py b/storage/zfcp.py
index b948eb5..c98c3ca 100644
--- a/storage/zfcp.py
+++ b/storage/zfcp.py
@@ -190,6 +190,7 @@ class ZFCP:
     def __init__(self):
         self.fcpdevs = []
         self.hasReadConfig = False
+        self.down = True
 
     def readConfig(self):
         try:
@@ -234,6 +235,9 @@ class ZFCP:
             self.fcpdevs.append(d)
 
     def shutdown(self):
+        if self.down:
+            return
+        self.down = True
         if len(self.fcpdevs) == 0:
             return
         for d in self.fcpdevs:
@@ -243,9 +247,14 @@ class ZFCP:
                 log.warn(str(e))
 
     def startup(self):
+        if not self.down:
+            return
+        self.down = False
         if not self.hasReadConfig:
             self.readConfig()
             self.hasReadConfig = True
+            # readConfig calls addFCP which calls onlineDevice already
+            return
             
         if len(self.fcpdevs) == 0:
             return
-- 
1.6.4


_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux