|
43 | 43 | script = os.path.realpath(sys.argv[0])
|
44 | 44 |
|
45 | 45 | # helper functions
|
46 |
| -is_str = lambda s: isinstance(s, str) |
47 |
| -is_dict = lambda d: isinstance(d, dict) |
48 |
| -is_list = lambda l: not is_str(l) and not is_dict(l) and hasattr(l, "__iter__") |
| 46 | + |
| 47 | + |
| 48 | +def is_str(string_object): |
| 49 | + return isinstance(string_object, str) |
| 50 | + |
| 51 | + |
| 52 | +def is_dict(dict_object): |
| 53 | + return isinstance(dict_object, dict) |
| 54 | + |
| 55 | + |
| 56 | +def is_list(list_object): |
| 57 | + return not is_str(list_object) and not is_dict(list_object) and hasattr(list_object, "__iter__") |
| 58 | + |
| 59 | + |
49 | 60 | # identity filter
|
50 |
| -filteri = lambda a: filter(lambda i: i, a) |
| 61 | +def filteri(a): |
| 62 | + return filter(lambda i: i, a) |
51 | 63 |
|
52 | 64 |
|
53 | 65 | def try_int(i, fallback=None):
|
@@ -797,7 +809,9 @@ def get_net_args(compose, cnt):
|
797 | 809 | cnt_nets = cnt.get("networks", None)
|
798 | 810 | aliases = [service_name]
|
799 | 811 | # NOTE: from podman manpage:
|
800 |
| - # NOTE: A container will only have access to aliases on the first network that it joins. This is a limitation that will be removed in a later release. |
| 812 | + # NOTE: A container will only have access to aliases on the first network |
| 813 | + # that it joins. This is a limitation that will be removed in a later |
| 814 | + # release. |
801 | 815 | ip = None
|
802 | 816 | ip6 = None
|
803 | 817 | if cnt_nets and is_dict(cnt_nets):
|
@@ -1127,7 +1141,11 @@ def run(
|
1127 | 1141 | log(" ".join([str(i) for i in cmd_ls]))
|
1128 | 1142 | if self.dry_run:
|
1129 | 1143 | return None
|
1130 |
| - # subprocess.Popen(args, bufsize = 0, executable = None, stdin = None, stdout = None, stderr = None, preexec_fn = None, close_fds = False, shell = False, cwd = None, env = None, universal_newlines = False, startupinfo = None, creationflags = 0) |
| 1144 | + # subprocess.Popen( |
| 1145 | + # args, bufsize = 0, executable = None, stdin = None, stdout = None, stderr = None, preexec_fn = None, |
| 1146 | + # close_fds = False, shell = False, cwd = None, env = None, universal_newlines = False, startupinfo = None, |
| 1147 | + # creationflags = 0 |
| 1148 | + # ) |
1131 | 1149 | if log_formatter is not None:
|
1132 | 1150 | # Pipe podman process output through log_formatter (which can add colored prefix)
|
1133 | 1151 | p = subprocess.Popen(
|
@@ -1799,7 +1817,7 @@ def is_local(container: dict) -> bool:
|
1799 | 1817 | * has a build section and is not prefixed
|
1800 | 1818 | """
|
1801 | 1819 | return (
|
1802 |
| - not "/" in container["image"] |
| 1820 | + "/" not in container["image"] |
1803 | 1821 | if "build" in container
|
1804 | 1822 | else container["image"].startswith("localhost/")
|
1805 | 1823 | )
|
@@ -2522,7 +2540,8 @@ def compose_up_parse(parser):
|
2522 | 2540 | "-d",
|
2523 | 2541 | "--detach",
|
2524 | 2542 | action="store_true",
|
2525 |
| - help="Detached mode: Run container in the background, print new container name. Incompatible with --abort-on-container-exit.", |
| 2543 | + help="Detached mode: Run container in the background, print new container name. \ |
| 2544 | + Incompatible with --abort-on-container-exit.", |
2526 | 2545 | )
|
2527 | 2546 | parser.add_argument(
|
2528 | 2547 | "--no-color", action="store_true", help="Produce monochrome output."
|
@@ -2573,7 +2592,8 @@ def compose_up_parse(parser):
|
2573 | 2592 | "--timeout",
|
2574 | 2593 | type=int,
|
2575 | 2594 | default=None,
|
2576 |
| - help="Use this timeout in seconds for container shutdown when attached or when containers are already running. (default: 10)", |
| 2595 | + help="Use this timeout in seconds for container shutdown when attached or when containers are already running. \ |
| 2596 | + (default: 10)", |
2577 | 2597 | )
|
2578 | 2598 | parser.add_argument(
|
2579 | 2599 | "-V",
|
|
0 commit comments