Created
March 18, 2013 17:16
-
-
Save jimi-c/5188949 to your computer and use it in GitHub Desktop.
Quick (untested) patch to remote.py in cobbler to prevent a failed power system call from stopping execution on other systems
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/cobbler/remote.py b/cobbler/remote.py | |
index 181b5c6..8ef45b7 100644 | |
--- a/cobbler/remote.py | |
+++ b/cobbler/remote.py | |
@@ -255,8 +255,11 @@ class CobblerXMLRPCInterface: | |
def background_power_system(self, options, token): | |
def runner(self): | |
for x in self.options.get("systems",[]): | |
- object_id = self.remote.get_system_handle(x,token) | |
- self.remote.power_system(object_id,self.options.get("power",""),token,logger=self.logger) | |
+ try: | |
+ object_id = self.remote.get_system_handle(x,token) | |
+ self.remote.power_system(object_id,self.options.get("power",""),token,logger=self.logger) | |
+ except: | |
+ self.logger.warning("failed to execute power task on %s" % str(x)) | |
return True | |
self.check_access(token, "power") | |
return self.__start_task(runner, token, "power", "Power management (%s)" % options.get("power",""), options) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment