Do not terminate on callback failure.

Show the error if a callback command fails and move on.
Set the executable bit for the aws callback.
This commit is contained in:
Oleksii Kliukin
2015-07-17 17:26:28 +02:00
parent a11d94aff5
commit e9934be9aa
+6 -1
View File
@@ -251,7 +251,12 @@ class Postgresql:
logger.warning("unable to perform {0} action, cannot obtain the cluster role: {1}".format(cb_name, e))
return False
name = self.name
subprocess.Popen(shlex.split(os.path.abspath(cmd))+[cb_name, "master" if is_leader else "replica", name])
try:
role = "master" if is_leader else "replica"
subprocess.Popen(shlex.split(os.path.abspath(cmd))+[cb_name, role, name])
except Exception as e:
logger.warning("callback {0} {1} {2} {3} failed: {4}".format(os.path.abspath(cmd), cb_name, role, name, e))
return False
return True
def start(self):