Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/gui/failover/forms.py b/gui/failover/forms.py
- index 4c45ad1..aa2ab14 100644
- --- a/gui/failover/forms.py
- +++ b/gui/failover/forms.py
- @@ -54,9 +54,24 @@ class FailoverForm(ModelForm):
- pass
- if imported:
- os.system('/usr/local/bin/python /usr/local/sbin/fenced force')
- - notifier().start("ix-devd")
- return obj
- + def done(self, *args, **kwargs):
- + s = notifier().failover_rpc()
- + if self.instance.master is True:
- + try:
- + s.run_sql("UPDATE system_failover SET master = %s", ["0"])
- + except:
- + # this will get journalled
- + pass
- + else:
- + try:
- + s.run_sql("UPDATE system_failover SET master = %s", ["1"])
- + except:
- + # this will get journalled
- + pass
- + super(FailoverForm, self).done(*args, **kwargs)
- + notifier().start("ix-devd")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement