Skip to content

Commit

Permalink
Merge pull request #562 from rhatdan/stop
Browse files Browse the repository at this point in the history
Fix podman stop --all
  • Loading branch information
rhatdan authored Jan 9, 2025
2 parents 3ea7e3c + 20f49ac commit ad08674
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions ramalama/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,16 +385,17 @@ def _list_containers(args):
raise IndexError("no container manager (Podman, Docker) found")

conman_args = [conman, "ps", "-a", "--filter", "label=RAMALAMA"]
if args.noheading:
if hasattr(args, "noheading") and args.noheading:
conman_args += ["--noheading"]

if hasattr(args, "notrunc") and args.notrunc:
conman_args += ["--no-trunc"]

if args.format:
conman_args += [f"--format={args.format}"]

try:
output = run_cmd(conman_args).stdout.decode("utf-8").strip()
output = run_cmd(conman_args, debug=args.debug).stdout.decode("utf-8").strip()
if output == "":
return []
return output.split("\n")
Expand Down Expand Up @@ -746,7 +747,7 @@ def _stop_container(args, name):

conman_args += [name]
try:
run_cmd(conman_args, ignore_stderr=ignore_stderr)
run_cmd(conman_args, ignore_stderr=ignore_stderr, debug=args.debug)
except subprocess.CalledProcessError:
if args.ignore and conman == "docker":
return
Expand Down Expand Up @@ -817,7 +818,6 @@ def rm_cli(args):
if len(args.MODEL) > 0:
raise IndexError("can not specify --all as well MODEL")

args.noheading = True
models = [k['name'] for k in _list_models(args)]
_rm_model(models, args)

Expand Down
2 changes: 1 addition & 1 deletion ramalama/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def find_working_directory():
def run_curl_cmd(args, filename):
if not verify_checksum(filename):
try:
run_cmd(args)
run_cmd(args, debug=args.debug)
except subprocess.CalledProcessError as e:
if e.returncode == 22:
perror(filename + " not found")
Expand Down

0 comments on commit ad08674

Please sign in to comment.