Added more comments

This commit is contained in:
strNophix 2022-04-08 22:32:30 +02:00
parent 6608e1216b
commit b546e03e37
2 changed files with 7 additions and 1 deletions

6
cli.py
View File

@ -193,6 +193,10 @@ def recover_env(args: argparse.Namespace):
def create_env(args: argparse.Namespace):
"""
Managing environments works in a declarative way and thus it can
also be used for updating.
"""
if (args.num_nginx_web + args.num_nginx_lb + args.num_postgres) == 0:
raise Exception("At least one item should be deployed")
@ -306,7 +310,7 @@ def main() -> int:
# CLI definition for positional arg "create"
cenv_parser = sub_parser.add_parser("create",
help="create a new environment")
help="create/update an environment")
cenv_parser.add_argument("customer_name",
type=str,
help="name of the customer")

View File

@ -80,6 +80,8 @@ def main() -> int:
lambda x: bool(RE_TEXT.match(x)))
"""
Ensures the necessary customer setup.
NOTE: The customer and the `envs` directory inside of it never get removed.
"""
envs_dir = path.join("customers", customer_name, "envs")
Path(envs_dir).mkdir(parents=True, exist_ok=True)