Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix user sync for Airflow 2.9.0 #848

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions charts/airflow/templates/sync/_helpers/sync_users.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,19 @@ flask_appbuilder = flask_app.appbuilder

# airflow moves the User and Role models around in different versions
try:
# since 2.7.0
from airflow.auth.managers.fab.models import User, Role
# since 2.9.0
from airflow.providers.fab.auth_manager.models import User, Role
except ModuleNotFoundError:
try:
# from 2.3.0 to 2.6.3
from airflow.www.fab_security.sqla.models import User, Role
# from 2.7.0 to 2.8.4
from airflow.auth.managers.fab.models import User, Role
except ModuleNotFoundError:
# before 2.3.0
from flask_appbuilder.security.sqla.models import User, Role
try:
# from 2.3.0 to 2.6.3
from airflow.www.fab_security.sqla.models import User, Role
except ModuleNotFoundError:
# before 2.3.0
from flask_appbuilder.security.sqla.models import User, Role


#############
Expand Down Expand Up @@ -237,4 +241,4 @@ main(sync_forever=True)
main(sync_forever=False)
{{- end }}

{{- end }}
{{- end }}
Loading