Commit 4ea2fa49 authored by Sunil Mohan Adapa's avatar Sunil Mohan Adapa Committed by Joseph Nuthalapati

cockpit: Don't handle domains if app is not installed

Signed-off-by: Sunil Mohan Adapa's avatarSunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati's avatarJoseph Nuthalapati <njoseph@thoughtworks.com>
parent d8ddf6ab
......@@ -132,15 +132,21 @@ def diagnose():
def on_domain_added(sender, domain_type, name, description='', services=None,
**kwargs):
"""Handle addition of a new domain."""
actions.superuser_run('cockpit', ['add-domain', name])
setup_helper = globals()['setup_helper']
if setup_helper.get_state() != 'needs-setup':
actions.superuser_run('cockpit', ['add-domain', name])
def on_domain_removed(sender, domain_type, name, **kwargs):
"""Handle removal of a domain."""
actions.superuser_run('cockpit', ['remove-domain', name])
setup_helper = globals()['setup_helper']
if setup_helper.get_state() != 'needs-setup':
actions.superuser_run('cockpit', ['remove-domain', name])
def on_domainname_change(sender, old_domainname, new_domainname, **kwargs):
"""Handle change of a domain."""
actions.superuser_run('cockpit', ['remove-domain', old_domainname])
actions.superuser_run('cockpit', ['add-domain', new_domainname])
setup_helper = globals()['setup_helper']
if setup_helper.get_state() != 'needs-setup':
actions.superuser_run('cockpit', ['remove-domain', old_domainname])
actions.superuser_run('cockpit', ['add-domain', new_domainname])
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment