Merge "Split string commands on whitespace"
This commit is contained in:
commit
e8c10b6263
@ -88,7 +88,7 @@ def command_argument(cmd, command):
|
||||
if not command:
|
||||
return []
|
||||
if not isinstance(command, list):
|
||||
return [command]
|
||||
return command.split()
|
||||
return command
|
||||
|
||||
|
||||
|
@ -50,11 +50,12 @@ class HookDockerCmdTest(common.RunScriptTest):
|
||||
"web": {
|
||||
"name": "y",
|
||||
"start_order": 1,
|
||||
"image": "xxx",
|
||||
"image": "yyy",
|
||||
"net": "host",
|
||||
"restart": "always",
|
||||
"privileged": True,
|
||||
"user": "root",
|
||||
"command": "/bin/webserver start",
|
||||
"volumes": [
|
||||
"/run:/run",
|
||||
"db:/var/lib/db"
|
||||
@ -175,6 +176,7 @@ class HookDockerCmdTest(common.RunScriptTest):
|
||||
'--env=foo=bar',
|
||||
'--privileged=false',
|
||||
'xxx'
|
||||
''
|
||||
], state[1]['args'])
|
||||
self.assertEqual([
|
||||
self.fake_tool_path,
|
||||
@ -209,7 +211,9 @@ class HookDockerCmdTest(common.RunScriptTest):
|
||||
'--user=root',
|
||||
'--volume=/run:/run',
|
||||
'--volume=db:/var/lib/db',
|
||||
'xxx'
|
||||
'yyy',
|
||||
'/bin/webserver',
|
||||
'start'
|
||||
], state[3]['args'])
|
||||
self.assertEqual([
|
||||
self.fake_tool_path,
|
||||
@ -366,7 +370,9 @@ class HookDockerCmdTest(common.RunScriptTest):
|
||||
'--user=root',
|
||||
'--volume=/run:/run',
|
||||
'--volume=db:/var/lib/db',
|
||||
'xxx'
|
||||
'yyy',
|
||||
'/bin/webserver',
|
||||
'start'
|
||||
], state[3]['args'])
|
||||
self.assertEqual([
|
||||
self.fake_tool_path,
|
||||
@ -508,7 +514,9 @@ class HookDockerCmdTest(common.RunScriptTest):
|
||||
'--user=root',
|
||||
'--volume=/run:/run',
|
||||
'--volume=db:/var/lib/db',
|
||||
'xxx'
|
||||
'yyy',
|
||||
'/bin/webserver',
|
||||
'start'
|
||||
], state[5]['args'])
|
||||
self.assertEqual([
|
||||
self.fake_tool_path,
|
||||
|
Loading…
Reference in New Issue
Block a user