def main(): """Start of program.""" from docopt import docopt args = docopt(__doc__, version="v0.0.2") # create database connection connect_from_config() # configure celery configure_app() total_new_count = 0 domains = Domain.objects(domain__ne="nasa.gov").batch_size(1) print(f"{domains.count()} domains to process") total_new_count += load_certs(domains, args["--skipto"], args["--verbose"], args["--dry-run"]) print(f"{total_new_count} certificates were imported for " f"{len(domains)} domains. (so far)") domains = Domain.objects(domain="nasa.gov").batch_size(1) print("processing nasa (troublesome)") total_new_count += load_certs(domains, args["--skipto"], args["--verbose"], args["--dry-run"]) print(f"{total_new_count} certificates were imported for " f"{len(domains)} domains.")
def main(): """Start executing at main entry point.""" from docopt import docopt args = docopt(__doc__, version="v0.0.1") if args["--list-connections"]: print_connections() sys.exit(0) from_alias = args["<from_connection>"] to_alias = args["<to_connection>"] # connect to databases connect_from_config() # # Copy all documents from certs collection # copy_all(Cert, from_alias, to_alias) # # # Copy all documents from precerts collection # with context_managers.switch_collection(Cert, "precerts"): # copy_all(Cert, from_alias, to_alias) # copy_all(Domain, from_alias, to_alias)
def main(): """Start of program.""" print(f"Context manager loaded: {context_managers}") connect_from_config() # with context_managers.switch_connection(Cert, "production"): import IPython IPython.embed() # noqa: E702 <<< BREAKPOINT >>>
def main(): """Start of program.""" from docopt import docopt args = docopt(__doc__, version="v0.0.2") # create database connection connect_from_config() # configure celery configure_app() domains = Domain.objects.batch_size(1) print(f"{domains.count()} domains to process") total_new_count = load_certs(domains, args["--skipto"], args["--verbose"]) print(f"{total_new_count} certificates were imported for " f"{len(domains)} domains.")