Skip to content

Commit

Permalink
fixed providers error message
Browse files Browse the repository at this point in the history
  • Loading branch information
jonhspyro committed Jun 19, 2024
1 parent 5198380 commit c0d610b
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions airflow/providers/fab/auth_manager/cli_commands/user_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,10 +212,12 @@ def users_import(args):

users_created, users_updated = _import_users(users_list)
if users_created:
print("Created the following users:\n\t{}".format("\n\t".join(users_created)))
users_created_str = "\n\t".join(users_created)
print(f"Created the following users:\n\t{users_created_str}")

if users_updated:
print("Updated the following users:\n\t{}".format("\n\t".join(users_updated)))
users_updated_str = "\n\t".join(users_updated)
print(f"Updated the following users:\n\t{users_updated_str}")


def _import_users(users_list: list[dict[str, Any]]):
Expand All @@ -231,10 +233,7 @@ def _import_users(users_list: list[dict[str, Any]]):
msg.append(f"[Item {row_num}]")
for key, value in failure.items():
msg.append(f"\t{key}: {value}")
raise SystemExit(
"Error: Input file didn't pass validation. See below:\n{}".format("\n".join(msg))
)

raise SystemExit(f"Error: Input file didn't pass validation.\\nErrors:\\n{msg}")
for user in users_list:
roles = []
for rolename in user["roles"]:
Expand Down

0 comments on commit c0d610b

Please sign in to comment.