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:
Sunil Mohan Adapa 2015-05-26 16:10:54 +05:30
parent 128aa42873
commit 393095db4e
2 changed files with 3 additions and 2 deletions

View File

@ -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()

View File

@ -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)