mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-05-20 10:34:30 +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):
|
def subcommand_pre_install(arguments):
|
||||||
"""Preseed debconf values before packages are installed."""
|
"""Preseed debconf values before packages are installed."""
|
||||||
domainname = arguments.domainname.strip("'")
|
domainname = arguments.domainname
|
||||||
if not domainname:
|
if not domainname:
|
||||||
# If new domainname is blank, use hostname instead.
|
# If new domainname is blank, use hostname instead.
|
||||||
domainname = socket.gethostname()
|
domainname = socket.gethostname()
|
||||||
@ -157,7 +157,7 @@ def subcommand_change_hostname(arguments):
|
|||||||
|
|
||||||
def subcommand_change_domainname(arguments):
|
def subcommand_change_domainname(arguments):
|
||||||
"""Update ejabberd and jwchat with new domainname"""
|
"""Update ejabberd and jwchat with new domainname"""
|
||||||
domainname = arguments.domainname.strip("'")
|
domainname = arguments.domainname
|
||||||
if not domainname:
|
if not domainname:
|
||||||
# If new domainname is blank, use hostname instead.
|
# If new domainname is blank, use hostname instead.
|
||||||
domainname = socket.gethostname()
|
domainname = socket.gethostname()
|
||||||
|
|||||||
@ -122,6 +122,7 @@ class TestPrivileged(unittest.TestCase):
|
|||||||
('&', 'echo', 'hello'),
|
('&', 'echo', 'hello'),
|
||||||
(r'\;', 'echo' 'hello'),
|
(r'\;', 'echo' 'hello'),
|
||||||
('|', 'echo', 'hello'),
|
('|', 'echo', 'hello'),
|
||||||
|
('', 'echo', '', 'hello'), # Empty option argument
|
||||||
tuple(r':;!&\/$%@`"~#*(){}[]|+='))
|
tuple(r':;!&\/$%@`"~#*(){}[]|+='))
|
||||||
for options in option_lists:
|
for options in option_lists:
|
||||||
output = run('echo', options)
|
output = run('echo', options)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user