mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-07-22 11:59:33 +00:00
cockpit: Don't error out when removing an unknown domain
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
ba8db1b4b5
commit
76725a0068
@ -94,9 +94,13 @@ def subcommand_remove_domain(arguments):
|
||||
"""Disallow a domain from being origin for Cockpit's WebSocket."""
|
||||
aug = load_augeas()
|
||||
origins = _get_origin_domains(aug)
|
||||
origins.remove(_get_origin_from_domain(arguments.domain_name))
|
||||
_set_origin_domains(aug, origins)
|
||||
aug.save()
|
||||
try:
|
||||
origins.remove(_get_origin_from_domain(arguments.domain_name))
|
||||
except KeyError:
|
||||
pass
|
||||
else:
|
||||
_set_origin_domains(aug, origins)
|
||||
aug.save()
|
||||
|
||||
|
||||
def load_augeas():
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user