mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-15 15:35:14 +02:00
Started updates to master migration file. Made update to terminal_helper so prompt no longer provides "skip" option
This commit is contained in:
parent
d321b31486
commit
a8188cb08f
2 changed files with 20 additions and 6 deletions
|
@ -95,6 +95,19 @@ class Command(BaseCommand):
|
||||||
)
|
)
|
||||||
|
|
||||||
# The following file arguments have default values for running in the sandbox
|
# The following file arguments have default values for running in the sandbox
|
||||||
|
|
||||||
|
# TODO: make this a mandatory argument (if/when we strip out defaults, it will be mandatory)
|
||||||
|
# TODO: use the migration directory arg or force user to type FULL filepath?
|
||||||
|
parser.add_argument(
|
||||||
|
"--migrationJson",
|
||||||
|
default="/app/management/commands/utility/dataFile.json", # TODO: Get rid of this once done? Or leave it as defaults??
|
||||||
|
help=(
|
||||||
|
"A JSON file that holds the location and filenames"
|
||||||
|
"of all the data files used for migrations"
|
||||||
|
),
|
||||||
|
)
|
||||||
|
|
||||||
|
# TODO: deprecate this once JSON module is done? (or keep as an override)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--migrationDirectory",
|
"--migrationDirectory",
|
||||||
default="migrationdata",
|
default="migrationdata",
|
||||||
|
@ -103,6 +116,8 @@ class Command(BaseCommand):
|
||||||
"load_transition_domain migration script"
|
"load_transition_domain migration script"
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# TODO: deprecate this once JSON module is done? (or keep as an override)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--migrationFilenames",
|
"--migrationFilenames",
|
||||||
default="escrow_domain_contacts.daily.gov.GOV.txt,"
|
default="escrow_domain_contacts.daily.gov.GOV.txt,"
|
||||||
|
|
|
@ -81,7 +81,7 @@ class TerminalHelper:
|
||||||
|
|
||||||
The "answer" return value is True for "yes" or False for "no".
|
The "answer" return value is True for "yes" or False for "no".
|
||||||
"""
|
"""
|
||||||
valid = {"yes": True, "y": True, "ye": True, "no": False, "n": False, "e": "exit", "s": "skip"}
|
valid = {"yes": True, "y": True, "ye": True, "no": False, "n": False, "e": "exit"}
|
||||||
if default is None:
|
if default is None:
|
||||||
prompt = " [y/n] "
|
prompt = " [y/n] "
|
||||||
elif default == "yes":
|
elif default == "yes":
|
||||||
|
@ -148,12 +148,13 @@ class TerminalHelper:
|
||||||
"""Create to reduce code complexity.
|
"""Create to reduce code complexity.
|
||||||
Prompts the user to inspect the given string
|
Prompts the user to inspect the given string
|
||||||
and asks if they wish to proceed.
|
and asks if they wish to proceed.
|
||||||
Returns true if the user responds (y),
|
If the user responds (y), returns TRUE
|
||||||
Returns false if the user responds (n)"""
|
If the user responds (n), either returns FALSE
|
||||||
|
or exits the system if system_exit_on_terminate = TRUE"""
|
||||||
|
|
||||||
action_description_for_selecting_no = "skip, E = exit"
|
action_description_for_selecting_no = "skip, E = exit"
|
||||||
if system_exit_on_terminate:
|
if system_exit_on_terminate:
|
||||||
action_description_for_selecting_no = "exit, S = skip"
|
action_description_for_selecting_no = "exit"
|
||||||
|
|
||||||
# Allow the user to inspect the command string
|
# Allow the user to inspect the command string
|
||||||
# and ask if they wish to proceed
|
# and ask if they wish to proceed
|
||||||
|
@ -176,8 +177,6 @@ class TerminalHelper:
|
||||||
if system_exit_on_terminate:
|
if system_exit_on_terminate:
|
||||||
sys.exit()
|
sys.exit()
|
||||||
return False
|
return False
|
||||||
if proceed_execution == "skip":
|
|
||||||
return False
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue