agrc / auditor

A scheduled tool to help keep ArcGIS Online content in compliance with UGRC standards
MIT License
1 stars 0 forks source link

Catch arcpy import failing to get a license #63

Open jacobdadams opened 3 years ago

jacobdadams commented 3 years ago

On line 32 in cli.py, from .auditor import Auditor, credentials, auditor.py then imports arcpy. If arcpy can't get a license, it raises a RuntimeError or ValueError (don't remember which).

Because these imports happen before our supervisor object is set up, it appears to bomb out silently.

Either create the supervisor before the rest of the imports, or move the imports that result in the arcpy import after the supervisor has been created.

stdavis commented 3 years ago

This code from forklift may be helpful: https://github.com/agrc/forklift/blob/bcacf00f735de855c2cc589decb024cc3c8726e7/src/forklift/__main__.py#L64-L75

jacobdadams commented 3 years ago

Thanks, I was just looking at that. I'm also investigating whether __init__.py is a good place for this as well.