mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-11-29 08:25:10 +00:00
utils: Simplify YAMLFile by removing the post_exit argument
Whatever function is passed in post_exit can simply be called by the caller itself as the next statement. Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com> Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
1 parent
938dadcae0
commit
753881b80f
3 files changed
+5
-9
No files matched your search
@@ -31,7 +31,6 @@ from plinth import action_utils
|
||||
from plinth.modules import letsencrypt
|
||||
from plinth.modules.matrixsynapse import (CONFIG_FILE_PATH,
|
||||
get_configured_domain_name)
|
||||
from plinth.utils import YAMLFile
|
||||
|
||||
|
||||
def parse_arguments():
|
||||
|
||||
+4
-2
@@ -189,17 +189,19 @@ def subcommand_add_introducer(arguments):
|
||||
|
||||
Param introducer must be a tuple of (pet_name, furl).
|
||||
"""
|
||||
with YAMLFile(introducers_file, restart_storage_node) as conf:
|
||||
with YAMLFile(introducers_file) as conf:
|
||||
pet_name, furl = arguments.introducer.split(",")
|
||||
conf['introducers'][pet_name] = {'furl': furl}
|
||||
restart_storage_node()
|
||||
|
||||
|
||||
def subcommand_remove_introducer(arguments):
|
||||
"""Rename the introducer entry in the introducers.yaml file specified
|
||||
by the param pet_name
|
||||
"""
|
||||
with YAMLFile(introducers_file, restart_storage_node) as conf:
|
||||
with YAMLFile(introducers_file) as conf:
|
||||
del conf['introducers'][arguments.pet_name]
|
||||
restart_storage_node()
|
||||
|
||||
|
||||
def subcommand_get_introducers(_):
|
||||
|
||||
Reference in new issue
Block a user