metrics: don't fail if no argument is given to command
This commit is contained in:
parent
f92e713e98
commit
430ef0f86a
1 changed files with 5 additions and 1 deletions
|
@ -27,7 +27,11 @@ app.register_blueprint(portal, url_prefix="/portal")
|
|||
app.register_blueprint(tfstate, url_prefix="/tfstate")
|
||||
|
||||
|
||||
if 'nose' not in sys.modules.keys() and sys.argv[1] != "db":
|
||||
def not_migrating() -> bool:
|
||||
return len(sys.argv) < 2 or sys.argv[1] != "db"
|
||||
|
||||
|
||||
if 'nose' not in sys.modules.keys() and not_migrating():
|
||||
from app.metrics import DefinedProxiesCollector, BlockedProxiesCollector, AutomationCollector
|
||||
|
||||
REGISTRY.register(DefinedProxiesCollector(app))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue