mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-08-15 14:04:10 +02:00
Add logging / additional validation
This commit is contained in:
parent
1b1a241101
commit
dca3eb5676
2 changed files with 16 additions and 0 deletions
|
@ -20,6 +20,11 @@ class Command(BaseCommand):
|
||||||
# Ensures a slash is added
|
# Ensures a slash is added
|
||||||
directory = os.path.join(options.get("directory"), "")
|
directory = os.path.join(options.get("directory"), "")
|
||||||
logger.info("Generating report...")
|
logger.info("Generating report...")
|
||||||
|
|
||||||
|
# TODO - Delete
|
||||||
|
current_directory = os.getcwd()
|
||||||
|
logger.info(f"Current working directory: {current_directory}")
|
||||||
|
|
||||||
self.generate_current_federal_report(directory)
|
self.generate_current_federal_report(directory)
|
||||||
logger.info(f"Success! Created {directory}current-federal.csv")
|
logger.info(f"Success! Created {directory}current-federal.csv")
|
||||||
|
|
||||||
|
@ -28,3 +33,6 @@ class Command(BaseCommand):
|
||||||
file_path = os.path.join(directory, "current-federal.csv")
|
file_path = os.path.join(directory, "current-federal.csv")
|
||||||
with open(file_path, "w") as file:
|
with open(file_path, "w") as file:
|
||||||
csv_export.export_data_federal_to_csv(file)
|
csv_export.export_data_federal_to_csv(file)
|
||||||
|
|
||||||
|
if not os.path.exists(file_path):
|
||||||
|
raise FileNotFoundError(f"Could not find newly created file at '{file_path}'")
|
||||||
|
|
|
@ -20,6 +20,11 @@ class Command(BaseCommand):
|
||||||
# Ensures a slash is added
|
# Ensures a slash is added
|
||||||
directory = os.path.join(options.get("directory"), "")
|
directory = os.path.join(options.get("directory"), "")
|
||||||
logger.info("Generating report...")
|
logger.info("Generating report...")
|
||||||
|
|
||||||
|
# TODO - Delete
|
||||||
|
current_directory = os.getcwd()
|
||||||
|
logger.info(f"Current working directory: {current_directory}")
|
||||||
|
|
||||||
self.generate_current_full_report(directory)
|
self.generate_current_full_report(directory)
|
||||||
logger.info(f"Success! Created {directory}current-full.csv")
|
logger.info(f"Success! Created {directory}current-full.csv")
|
||||||
|
|
||||||
|
@ -28,3 +33,6 @@ class Command(BaseCommand):
|
||||||
file_path = os.path.join(directory, "current-full.csv")
|
file_path = os.path.join(directory, "current-full.csv")
|
||||||
with open(file_path, "w") as file:
|
with open(file_path, "w") as file:
|
||||||
csv_export.export_data_full_to_csv(file)
|
csv_export.export_data_full_to_csv(file)
|
||||||
|
|
||||||
|
if not os.path.exists(file_path):
|
||||||
|
raise FileNotFoundError(f"Could not find newly created file at '{file_path}'")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue