Skip to content
Snippets Groups Projects
Verified Commit e4d56f88 authored by David Hoese's avatar David Hoese
Browse files

Add script if name == main to legacy db ingest python script

parent db34ccf4
No related branches found
No related tags found
No related merge requests found
...@@ -38,7 +38,7 @@ def configure_logging(level, logfn=None): ...@@ -38,7 +38,7 @@ def configure_logging(level, logfn=None):
LOG.addHandler(rotating_file) LOG.addHandler(rotating_file)
def main(*args): def main():
import argparse import argparse
parser = argparse.ArgumentParser(description=__doc__, parser = argparse.ArgumentParser(description=__doc__,
formatter_class=argparse.ArgumentDefaultsHelpFormatter) formatter_class=argparse.ArgumentDefaultsHelpFormatter)
...@@ -86,3 +86,7 @@ def main(*args): ...@@ -86,3 +86,7 @@ def main(*args):
failures = legacy_db.insert_records([data], station=station) failures = legacy_db.insert_records([data], station=station)
if failures: if failures:
ERR.info("(%s) %s", failures[0][0], record) ERR.info("(%s) %s", failures[0][0], record)
if __name__ == "__main__":
sys.exit(main())
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment