fix(api commands): cmdb-password-data-migrate (#249)

This commit is contained in:
pycook
2023-11-02 20:43:39 +08:00
committed by GitHub
parent 9d5bdf1b0d
commit 0172206c7c
2 changed files with 8 additions and 2 deletions

View File

@@ -65,7 +65,8 @@ class KeyManage:
self.backend = Backend(backend)
def init_app(self, app, backend=None):
if sys.argv[0].endswith("gunicorn") or (len(sys.argv) > 1 and sys.argv[1] == "run"):
if (sys.argv[0].endswith("gunicorn") or
(len(sys.argv) > 1 and sys.argv[1] in ("run", "cmdb-password-data-migrate"))):
self.trigger = app.config.get("INNER_TRIGGER_TOKEN")
if not self.trigger:
return