mirror of
https://github.com/containers/podman-compose.git
synced 2025-01-23 22:39:04 +01:00
add systemd -a list
This commit is contained in:
parent
b620311aaf
commit
1a72e1e087
@ -16,6 +16,7 @@ import re
|
|||||||
import hashlib
|
import hashlib
|
||||||
import random
|
import random
|
||||||
import json
|
import json
|
||||||
|
import glob
|
||||||
|
|
||||||
from threading import Thread
|
from threading import Thread
|
||||||
|
|
||||||
@ -1726,6 +1727,10 @@ def compose_systemd(compose, args):
|
|||||||
f"""later you can use use enable, start, stop, status, cat
|
f"""later you can use use enable, start, stop, status, cat
|
||||||
like this `systemctl --user enable --now podman-compose@{proj_name}`"""
|
like this `systemctl --user enable --now podman-compose@{proj_name}`"""
|
||||||
)
|
)
|
||||||
|
elif args.action == "list" or args.action == "ls":
|
||||||
|
ls = glob.glob(os.path.expanduser(f"~/{stacks_dir}/*.env"))
|
||||||
|
for i in ls:
|
||||||
|
print(os.path.basename(i[:-4]))
|
||||||
elif args.action == "create-unit":
|
elif args.action == "create-unit":
|
||||||
script = os.path.realpath(sys.argv[0])
|
script = os.path.realpath(sys.argv[0])
|
||||||
fn = "/usr/lib/systemd/user/podman-compose@.service"
|
fn = "/usr/lib/systemd/user/podman-compose@.service"
|
||||||
@ -2512,7 +2517,7 @@ def compose_systemd_parse(parser):
|
|||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"-a",
|
"-a",
|
||||||
"--action",
|
"--action",
|
||||||
choices=["register", "create-unit"],
|
choices=["register", "create-unit", "list", "ls"],
|
||||||
default="register",
|
default="register",
|
||||||
help="create systemd unit file or register compose stack to it",
|
help="create systemd unit file or register compose stack to it",
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user