Move datastore client instantiation

As it is not needed for all commands
This commit is contained in:
Marian Steinbach 2021-11-11 20:02:42 +01:00
parent 664770e1cf
commit 728eb81eba
1 changed files with 3 additions and 2 deletions

5
cli.py
View File

@ -68,8 +68,6 @@ if __name__ == "__main__":
logging.debug("Called command %s", args.command)
datastore_client = datastore.Client.from_service_account_json(args.credentials_path)
if args.command == 'manager':
import manager
@ -78,10 +76,13 @@ if __name__ == "__main__":
elif args.command == 'export':
import export
datastore_client = datastore.Client.from_service_account_json(args.credentials_path)
export.export_results(datastore_client, args.kind)
else:
from spider import spider
datastore_client = datastore.Client.from_service_account_json(args.credentials_path)
if args.url:
# spider one URL for diagnostic purposes
spider.test_url(args.url)