cockpit: Don't handle the domain changed signal

Domain added and removed signals provide sufficient knowledge of domain name
changes.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa 2019-08-01 21:06:31 -07:00 committed by James Valleroy
parent 0dba497383
commit 012db6ac93
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808

View File

@ -28,7 +28,7 @@ from plinth.daemon import Daemon
from plinth.modules import names from plinth.modules import names
from plinth.modules.apache.components import Webserver from plinth.modules.apache.components import Webserver
from plinth.modules.firewall.components import Firewall from plinth.modules.firewall.components import Firewall
from plinth.signals import domain_added, domain_removed, domainname_change from plinth.signals import domain_added, domain_removed
from plinth.utils import format_lazy from plinth.utils import format_lazy
from .manifest import backup, clients # noqa, pylint: disable=unused-import from .manifest import backup, clients # noqa, pylint: disable=unused-import
@ -104,7 +104,6 @@ def init():
domain_added.connect(on_domain_added) domain_added.connect(on_domain_added)
domain_removed.connect(on_domain_removed) domain_removed.connect(on_domain_removed)
domainname_change.connect(on_domainname_change)
def setup(helper, old_version=None): def setup(helper, old_version=None):
@ -140,11 +139,3 @@ def on_domain_removed(sender, domain_type, name, **kwargs):
setup_helper = globals()['setup_helper'] setup_helper = globals()['setup_helper']
if setup_helper.get_state() != 'needs-setup': if setup_helper.get_state() != 'needs-setup':
actions.superuser_run('cockpit', ['remove-domain', name]) actions.superuser_run('cockpit', ['remove-domain', name])
def on_domainname_change(sender, old_domainname, new_domainname, **kwargs):
"""Handle change of a domain."""
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])