mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-03-11 09:04:54 +00:00
xmpp: Remove special handling for empty arguments
- As tested in the updated test case, subprocess module can send empty arguments properly to the invoked commands. No special handling is necessary.
This commit is contained in:
parent
128aa42873
commit
393095db4e
@ -93,7 +93,7 @@ def parse_arguments():
|
||||
|
||||
def subcommand_pre_install(arguments):
|
||||
"""Preseed debconf values before packages are installed."""
|
||||
domainname = arguments.domainname.strip("'")
|
||||
domainname = arguments.domainname
|
||||
if not domainname:
|
||||
# If new domainname is blank, use hostname instead.
|
||||
domainname = socket.gethostname()
|
||||
@ -157,7 +157,7 @@ def subcommand_change_hostname(arguments):
|
||||
|
||||
def subcommand_change_domainname(arguments):
|
||||
"""Update ejabberd and jwchat with new domainname"""
|
||||
domainname = arguments.domainname.strip("'")
|
||||
domainname = arguments.domainname
|
||||
if not domainname:
|
||||
# If new domainname is blank, use hostname instead.
|
||||
domainname = socket.gethostname()
|
||||
|
||||
@ -122,6 +122,7 @@ class TestPrivileged(unittest.TestCase):
|
||||
('&', 'echo', 'hello'),
|
||||
(r'\;', 'echo' 'hello'),
|
||||
('|', 'echo', 'hello'),
|
||||
('', 'echo', '', 'hello'), # Empty option argument
|
||||
tuple(r':;!&\/$%@`"~#*(){}[]|+='))
|
||||
for options in option_lists:
|
||||
output = run('echo', options)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user