File tree Expand file tree Collapse file tree 7 files changed +20
-9
lines changed
plugins/module_utils/podman
tests/integration/targets
podman_container_info/tasks
podman_network_info/tasks Expand file tree Collapse file tree 7 files changed +20
-9
lines changed Original file line number Diff line number Diff line change 55__metaclass__ = type
66
77import os
8+ import shlex
89
910from ansible_collections .containers .podman .plugins .module_utils .podman .common import compare_systemd_file_content
1011
@@ -169,9 +170,9 @@ def custom_prepare_params(self, params: dict) -> dict:
169170 if isinstance (params ["command" ], list )
170171 else params ["command" ])
171172 if params ["label" ]:
172- params ["label" ] = ["%s=%s" % (k , v ) for k , v in params ["label" ].items ()]
173+ params ["label" ] = [shlex . quote ( "%s=%s" % (k , v ) ) for k , v in params ["label" ].items ()]
173174 if params ["env" ]:
174- params ["env" ] = ["%s=%s" % (k , v ) for k , v in params ["env" ].items ()]
175+ params ["env" ] = [shlex . quote ( "%s=%s" % (k , v ) ) for k , v in params ["env" ].items ()]
175176 if params ["rootfs" ]:
176177 params ["rootfs" ] = params ["image" ]
177178 params ["image" ] = None
Original file line number Diff line number Diff line change 11[metadata]
22name = ansible-podman-collections.containers
33summary = Ansible collections for Podman
4- description-file =
4+ description_file =
55 README.md
66
77author = Sagi Shnaidman (@sshnaidm)
Original file line number Diff line number Diff line change 12931293 BAR : foo
12941294 TEST : 1
12951295 BOOL : false
1296+ WITH_SPACES : " a nice string"
12961297 label :
12971298 somelabel : labelvalue
12981299 otheralbe : othervalue
1300+ spacelabel : " a nice label"
12991301 log_opt :
13001302 max_size : 10mb
13011303 path : /var/log/container/mycontainer.json
13471349 - " Unmask=ALL"
13481350 - " SecurityLabelFileType=usr_t"
13491351 - " Environment=BOOL=False"
1352+ - " Environment='WITH_SPACES=a nice string'"
13501353 - " PublishPort=9001:8000"
13511354 - " AddHost=host2:127.0.0.1"
13521355 - " Label=somelabel=labelvalue"
1356+ - " Label='spacelabel=a nice label'"
13531357 - " WantedBy=default.target"
13541358 - " GroupAdd=admin"
13551359 - " GroupAdd=users"
14111415 BAR : foo
14121416 TEST : 1
14131417 BOOL : false
1418+ WITH_SPACES : " a nice string"
14141419 label :
14151420 somelabel : labelvalue
14161421 otheralbe : othervalue
1422+ spacelabel : " a nice label"
14171423 log_opt :
14181424 max_size : 10mb
14191425 path : /var/log/container/mycontainer.json
Original file line number Diff line number Diff line change 8585 assert :
8686 that :
8787 - " 'containers' in existing_container"
88- - existing_container.containers
88+ - existing_container.containers | length > 0
8989 # - "existing_container.containers == podman_inspect_result"
9090 # - all_containers.containers == existing_container.containers
9191 - " 'containers' in mixed_existing_container"
92- - mixed_existing_container.containers
92+ - mixed_existing_container.containers | length > 0
9393 # - existing_container.containers == mixed_existing_container.containers
9494
9595 always :
Original file line number Diff line number Diff line change 3737 assert :
3838 that :
3939 - " 'login' in non_existing_registry"
40- - non_existing_registry.login
40+ - non_existing_registry.login is not none
41+ - non_existing_registry.login != {}
42+ - non_existing_registry.login | length > 0
4143 - " 'registry' in non_existing_registry.login"
4244 - " 'username' in non_existing_registry.login"
4345 - " 'logged_in' in non_existing_registry.login"
5759 assert :
5860 that :
5961 - " 'login' in non_existing_authfile"
60- - non_existing_authfile.login
62+ - non_existing_authfile.login is not none
63+ - non_existing_authfile.login != {}
64+ - non_existing_authfile.login | length > 0
6165 - " 'username' in non_existing_authfile.login"
6266 - " 'logged_in' in non_existing_authfile.login"
6367 - " non_existing_authfile.login.username == ''"
Original file line number Diff line number Diff line change 5353 assert :
5454 that :
5555 - " 'networks' in existing_network"
56- - existing_network.networks
56+ - existing_network.networks | length > 0
5757 - " existing_network.networks == podman_inspect_result"
5858 always :
5959
Original file line number Diff line number Diff line change 6060 assert :
6161 that :
6262 - " 'volumes' in existing_volume"
63- - existing_volume.volumes
63+ - existing_volume.volumes | length > 0
6464 - " existing_volume.volumes == podman_inspect_result"
6565 always :
6666
You can’t perform that action at this time.
0 commit comments