pgsql is more strict, increase the hackiness up to 11

This commit is contained in:
2023-03-29 16:17:47 +03:00
parent 5648a6efa2
commit 5f7c69c57c

View File

@@ -139,6 +139,10 @@ if not os.path.exists(ENV_FILE):
# For GCE we need to create a service account (with Owner Role from the IAM section) and download the json file (from
# the Service Account's manage keys section) in the same directory as the script
if os.stat(ENV_FILE).st_size != 0 and args.init:
console.print("[bold red]The init flag was only meant to be optionally run once and only in the first run if you knew you were going to be using only one provider.[/bold red] [bold white]If you need to change or populate a provider\'s needed values use the [u]--edit[/u] or [u]-e[/u] flag instead[/bold white]")
exit(0)
# We then check if the .env file is empty to determine if it's the first run of the script
if os.stat(ENV_FILE).st_size == 0:
if args.init:
@@ -172,10 +176,6 @@ if os.stat(ENV_FILE).st_size == 0:
else:
console.print('[bold white]You will be asked for each needed value\nIf you want to skip a provider press enter on each of their values because they are all needed for authentication\nIf at some point you delete the provider\'s value entry you will once again be asked to enter it\nIf you pressed enter by mistake or inserted an incorrect value just edit the file directly or delete the corresponding line\nThere is also the choice of using the [u]-e[/u] option to have that done interactively[/bold white]')
if os.stat(ENV_FILE).st_size != 0 and args.init:
console.print("[bold red]The init flag was only meant to be optionally run once and only in the first run if you knew you were going to be using only one provider.[/bold red] [bold white]If you need to change or populate a provider\'s needed values use the [u]--edit[/u] or [u]-e[/u] flag instead[/bold white]")
exit(0)
# We search for these values in the ENV_FILE and for each not found, we prompt the user to enter it
# We then write the values to the ENV_FILE
# An empty string is allowed in case the user does not want to use a particular cloud provider