Changes command and entrypoint to type list
This commit is contained in:
parent
4cc872669c
commit
b15ceee6bd
1 changed files with 11 additions and 4 deletions
|
@ -574,7 +574,7 @@ EXAMPLES = '''
|
|||
docker_container:
|
||||
name: sleepy
|
||||
image: ubuntu:14.04
|
||||
command: sleep infinity
|
||||
command: ["sleep", "infinity"]
|
||||
|
||||
- name: Add container to networks
|
||||
docker_container:
|
||||
|
@ -801,6 +801,14 @@ class TaskParameters(DockerBaseClass):
|
|||
if network.get('links'):
|
||||
network['links'] = self._parse_links(network['links'])
|
||||
|
||||
if self.entrypoint:
|
||||
# convert from list to str.
|
||||
self.entrypoint = ' '.join([str(x) for x in self.entrypoint])
|
||||
|
||||
if self.command:
|
||||
# convert from list to str
|
||||
self.command = ' '.join([str(x) for x in self.command])
|
||||
|
||||
def fail(self, msg):
|
||||
self.client.module.fail_json(msg=msg)
|
||||
|
||||
|
@ -1483,7 +1491,6 @@ class Container(DockerBaseClass):
|
|||
return expected_devices
|
||||
|
||||
def _get_expected_entrypoint(self):
|
||||
self.log('_get_expected_entrypoint')
|
||||
if not self.parameters.entrypoint:
|
||||
return None
|
||||
return shlex.split(self.parameters.entrypoint)
|
||||
|
@ -1940,7 +1947,7 @@ def main():
|
|||
blkio_weight=dict(type='int'),
|
||||
capabilities=dict(type='list'),
|
||||
cleanup=dict(type='bool', default=False),
|
||||
command=dict(type='str'),
|
||||
command=dict(type='list'),
|
||||
cpu_period=dict(type='int'),
|
||||
cpu_quota=dict(type='int'),
|
||||
cpuset_cpus=dict(type='str'),
|
||||
|
@ -1953,7 +1960,7 @@ def main():
|
|||
dns_search_domains=dict(type='list'),
|
||||
env=dict(type='dict'),
|
||||
env_file=dict(type='path'),
|
||||
entrypoint=dict(type='str'),
|
||||
entrypoint=dict(type='list'),
|
||||
etc_hosts=dict(type='dict'),
|
||||
exposed_ports=dict(type='list', aliases=['exposed', 'expose']),
|
||||
force_kill=dict(type='bool', default=False, aliases=['forcekill']),
|
||||
|
|
Loading…
Reference in a new issue