Skip to content

Commit

Permalink
Added --log-opt: max_file option to podman_play.py. Signed-off-by: Ah…
Browse files Browse the repository at this point in the history
…mad Kasem [email protected]
  • Loading branch information
AhmadKasem committed Dec 29, 2023
1 parent b9c01e1 commit 9aa89a9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
14 changes: 3 additions & 11 deletions plugins/module_utils/podman/podman_container_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -467,22 +467,14 @@ def addparam_log_driver(self, c):
def addparam_log_opt(self, c):
for k, v in self.params['log_opt'].items():
if v is not None:
if k in ('max_file', 'max_size'):
opt = k.replace('_', '-')
c += ['--log-opt',
b"=".join([to_bytes(k.replace('max_size', 'max-size'),
errors='surrogate_or_strict'),
b"=".join([to_bytes(opt, errors='surrogate_or_strict'),
to_bytes(v,
errors='surrogate_or_strict')])]
return c

def addparam_log_opt_file_size(self, c):
for k, v in self.params['log_opt'].items():
if v is not None:
c += ['--log-opt',
b"=".join([to_bytes(k.replace('max_file', 'max-file'),
errors='surrogate_or_strict'),
to_bytes(v,
errors='surrogate_or_strict')])]
return c

def addparam_log_level(self, c):
return c + ['--log-level', self.params['log_level']]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
- play_container_info.containers.0.Config.Annotations["greet_to"] == "world"
- play_container_info.containers.0.HostConfig.LogConfig["Path"] == log_opt.path
- play_container_info.containers.0.HostConfig.LogConfig["Size"] | lower == log_opt.size
- play_container_info.containers.0.HostConfig.LogConfig["Size"] | lower == log_opt.file

always:

Expand Down

0 comments on commit 9aa89a9

Please sign in to comment.