Skip to content

Commit

Permalink
de-dupe deploy code
Browse files Browse the repository at this point in the history
  • Loading branch information
mplsgrant committed Dec 6, 2024
1 parent 6c43182 commit c15c3ca
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/warnet/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,7 @@ def deploy(directory, debug, namespace, to_all_users, unknown_args):
if unknown_args:
raise click.BadParameter(f"Unknown args: {unknown_args}{HINT}")

if to_all_users:
namespaces = get_namespaces_by_type(WARGAMES_NAMESPACE_PREFIX)
for namespace in namespaces:
_deploy(directory, debug, namespace.metadata.name, False)
else:
_deploy(directory, debug, namespace, to_all_users)
_deploy(directory, debug, namespace, to_all_users)


def _deploy(directory, debug, namespace, to_all_users):
Expand All @@ -81,7 +76,7 @@ def _deploy(directory, debug, namespace, to_all_users):
namespaces = get_namespaces_by_type(WARGAMES_NAMESPACE_PREFIX)
processes = []
for namespace in namespaces:
p = Process(target=deploy, args=(directory, debug, namespace.metadata.name, False))
p = Process(target=_deploy, args=(directory, debug, namespace.metadata.name, False))
p.start()
processes.append(p)
for p in processes:
Expand Down

0 comments on commit c15c3ca

Please sign in to comment.