Archived
Refactor for shiv package
This commit is contained in:
@@ -40,6 +40,10 @@ def command(ctx, include, exclude, cluster, command, services):
|
||||
verbose = ctx.obj.verbose
|
||||
dry_run = ctx.obj.dry_run
|
||||
|
||||
# See: https://stackoverflow.com/a/20885799/1701505
|
||||
from . import data
|
||||
compose_dir = importlib.resources.path(data, "compose")
|
||||
|
||||
if cluster is None:
|
||||
# Create default unique, stable cluster name from confile file path
|
||||
# TODO: change this to the config file path
|
||||
@@ -49,7 +53,6 @@ def command(ctx, include, exclude, cluster, command, services):
|
||||
if verbose:
|
||||
print(f"Using cluster name: {cluster}")
|
||||
|
||||
# See: https://stackoverflow.com/a/20885799/1701505
|
||||
from . import data
|
||||
with importlib.resources.open_text(data, "pod-list.txt") as pod_list_file:
|
||||
pods = pod_list_file.read().splitlines()
|
||||
@@ -62,7 +65,7 @@ def command(ctx, include, exclude, cluster, command, services):
|
||||
compose_files = []
|
||||
for pod in pods:
|
||||
if include_exclude_check(pod, include, exclude):
|
||||
compose_file_name = os.path.join("compose", f"docker-compose-{pod}.yml")
|
||||
compose_file_name = os.path.join(compose_dir, f"docker-compose-{pod}.yml")
|
||||
compose_files.append(compose_file_name)
|
||||
else:
|
||||
if verbose:
|
||||
|
||||
Reference in New Issue
Block a user