Skip to content

Commit 66c0ead

Browse files
committed
Merge branch 'add-podman_system_info-module' of github.com:johnsonlien/ansible-podman-collections into add-podman_system_info-module
2 parents 8045bf5 + dcd654f commit 66c0ead

File tree

7 files changed

+20
-9
lines changed

7 files changed

+20
-9
lines changed

plugins/module_utils/podman/quadlet.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
__metaclass__ = type
66

77
import os
8+
import shlex
89

910
from 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

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[metadata]
22
name = ansible-podman-collections.containers
33
summary = Ansible collections for Podman
4-
description-file =
4+
description_file =
55
README.md
66

77
author = Sagi Shnaidman (@sshnaidm)

tests/integration/targets/podman_container/tasks/main.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1293,9 +1293,11 @@
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
@@ -1347,9 +1349,11 @@
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"
@@ -1411,9 +1415,11 @@
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

tests/integration/targets/podman_container_info/tasks/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,11 @@
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:

tests/integration/targets/podman_login_info/tasks/main.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@
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"
@@ -57,7 +59,9 @@
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 == ''"

tests/integration/targets/podman_network_info/tasks/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
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

tests/integration/targets/podman_volume_info/tasks/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
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

0 commit comments

Comments
 (0)