uranusjr commented on code in PR #25854:
URL: https://github.com/apache/airflow/pull/25854#discussion_r952124722


##########
airflow/cli/commands/role_command.py:
##########
@@ -47,6 +47,16 @@ def roles_create(args):
     print(f"Added {len(args.role)} role(s)")
 
 
+@cli_utils.action_cli
+@suppress_logs_and_warning
+def roles_delete(args):
+    """Deletes role in DB"""
+    appbuilder = cached_app().appbuilder
+    for role_name in args.role:
+        appbuilder.sm.delete_role(role_name)

Review Comment:
   This crashes if `role_name` does not exist so you need to validate before 
passing the value in.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to