mirror of https://github.com/ansible/ansible.git
docker: exclude 'entrypoint' from comparing 'command' param with containers
The JSON the Docker API returns includes the container's ENTRYPOINT value (if it has one) with the 'Command' value. So instead of checking if `container['Command'] == module.params['command']`, we just check that `container['Command'].endswith(module.params['command'])` so the entrypoint won't affect a container being properly classified as matching the module params or not. Also I refactored a super-long `if` statement into some temporary variables - I did it to help me figure out what was going wrong, and then it makes the code more readable so I kept it.reviewable/pr18780/r1
parent
afd0e78f16
commit
0ce43d6e3c
Loading…
Reference in New Issue