Skip to content

Commit

Permalink
Migration commands shouldn't print a bunch of data. (apache#11961)
Browse files Browse the repository at this point in the history
  • Loading branch information
jhtimmins committed Oct 30, 2020
1 parent 4bd1131 commit 0473c9e
Showing 1 changed file with 0 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -289,19 +289,14 @@ def remap_permissions():
(old_view_name, old_perm_name) = old
old_pvm = appbuilder.sm.find_permission_view_menu(old_perm_name, old_view_name)
if not old_pvm:
print(f"There is not a PVM for {old_view_name}.{old_perm_name}")
continue
for new_perm_name, new_view_name in new:
new_pvm = appbuilder.sm.add_permission_view_menu(new_perm_name, new_view_name)
for role in appbuilder.sm.get_all_roles():
if appbuilder.sm.exist_permission_on_roles(old_view_name, old_perm_name, [role.id]):
appbuilder.sm.add_permission_role(role, new_pvm)
appbuilder.sm.del_permission_role(role, old_pvm)
print(
f"PRUNING: Perm View from Role {role.name} ----> {old_view_name}.{old_perm_name}"
)
appbuilder.sm.del_permission_view_menu(old_perm_name, old_view_name)
print(f"PRUNING: Permission View ----> {old_view_name}.{old_perm_name}")

if not appbuilder.sm.find_permission(old_perm_name):
continue
Expand All @@ -310,7 +305,6 @@ def remap_permissions():
[appbuilder.sm.find_permission_view_menu(old_perm_name, view.name) for view in view_menus]
):
appbuilder.sm.del_permission(old_perm_name)
print(f"PRUNING: Outdated Perm ----> {old_perm_name}")


def upgrade():
Expand Down

0 comments on commit 0473c9e

Please sign in to comment.