1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Fix lookup of parameter name to be pid instead of pid_mode

This commit is contained in:
Toshio Kuratomi 2015-03-13 07:31:55 -07:00 committed by Matt Clay
parent 09a0db1e1f
commit 1946f05baf

View file

@ -227,7 +227,7 @@ options:
version_added: "1.8" version_added: "1.8"
pid: pid:
description: description:
- Set the PID namespace mode for the container (currently only supports 'host'). Requires docker-py >= 1.0.0 and docker >= 1.4.1. - Set the PID namespace mode for the container (currently only supports 'host'). Requires docker-py >= 1.0.0 and docker >= 1.5.0
required: false required: false
default: None default: None
aliases: [] aliases: []
@ -490,7 +490,7 @@ class DockerManager(object):
'dns': ((0, 3, 0), '1.10'), 'dns': ((0, 3, 0), '1.10'),
'volumes_from': ((0, 3, 0), '1.10'), 'volumes_from': ((0, 3, 0), '1.10'),
'restart_policy': ((0, 5, 0), '1.14'), 'restart_policy': ((0, 5, 0), '1.14'),
'pid_mode': ((1, 0, 0), '1.17'), 'pid': ((1, 0, 0), '1.17'),
# Clientside only # Clientside only
'insecure_registry': ((0, 5, 0), '0.0') 'insecure_registry': ((0, 5, 0), '0.0')
} }
@ -1236,7 +1236,7 @@ class DockerManager(object):
optionals = {} optionals = {}
for optional_param in ('dns', 'volumes_from', 'restart_policy', for optional_param in ('dns', 'volumes_from', 'restart_policy',
'restart_policy_retry', 'pid_mode'): 'restart_policy_retry', 'pid'):
optionals[optional_param] = self.module.params.get(optional_param) optionals[optional_param] = self.module.params.get(optional_param)
if optionals['dns'] is not None: if optionals['dns'] is not None:
@ -1253,9 +1253,9 @@ class DockerManager(object):
if params['restart_policy']['Name'] == 'on-failure': if params['restart_policy']['Name'] == 'on-failure':
params['restart_policy']['MaximumRetryCount'] = optionals['restart_policy_retry'] params['restart_policy']['MaximumRetryCount'] = optionals['restart_policy_retry']
if optionals['pid_mode'] is not None: if optionals['pid'] is not None:
self.ensure_capability('pid_mode') self.ensure_capability('pid')
params['pid_mode'] = optionals['pid_mode'] params['pid_mode'] = optionals['pid']
for i in containers: for i in containers:
self.client.start(i['Id'], **params) self.client.start(i['Id'], **params)