1
0
Fork 0
mirror of https://github.com/containers/ansible-podman-collections.git synced 2026-02-04 07:11:49 +00:00

podman_container_lib: fix command idempotency

preserve case sensitivity by removing the use of lower() and using shlex
to split the command string
This commit is contained in:
Justin Riley 2021-01-11 14:13:24 -05:00
parent d9e392f47e
commit 9382c7a1e0

View file

@ -1,5 +1,6 @@
from __future__ import (absolute_import, division, print_function)
import json # noqa: F402
import shlex # noqa: F402
from distutils.version import LooseVersion # noqa: F402
from ansible.module_utils._text import to_bytes, to_native # noqa: F402
@ -713,9 +714,7 @@ class PodmanContainerDiff:
before = self.info['config']['cmd']
after = self.params['command']
if isinstance(after, str):
after = [i.lower() for i in after.split()]
elif isinstance(after, list):
after = [i.lower() for i in after]
after = shlex.split(after)
return self._diff_update_and_compare('command', before, after)
return False