diff --git a/services/comms/oneoffs/mas-local-users-ensure-job.yaml b/services/comms/oneoffs/mas-local-users-ensure-job.yaml index 20e1825..9775c68 100644 --- a/services/comms/oneoffs/mas-local-users-ensure-job.yaml +++ b/services/comms/oneoffs/mas-local-users-ensure-job.yaml @@ -225,21 +225,21 @@ spec: login_name = username if not login_name.startswith("@"): login_name = f"@{login_name}:{SERVER_NAME}" - r = request_with_retry( - "POST", - f"{AUTH_BASE}/_matrix/client/v3/login", - json={ - "type": "m.login.password", - "identifier": {"type": "m.id.user", "user": login_name}, - "password": password, - }, - timeout=30, - ) - if r.status_code == 429: - return False - if r.status_code != 200: - raise RuntimeError(f"login failed for {username}: {r.status_code} {r.text}") - return True + r = request_with_retry( + "POST", + f"{AUTH_BASE}/_matrix/client/v3/login", + json={ + "type": "m.login.password", + "identifier": {"type": "m.id.user", "user": login_name}, + "password": password, + }, + timeout=30, + ) + if r.status_code == 429: + return False + if r.status_code != 200: + raise RuntimeError(f"login failed for {username}: {r.status_code} {r.text}") + return True wait_for_service(MAS_ADMIN_API_BASE) token = admin_token() @@ -248,10 +248,10 @@ spec: bot_quick_pass = os.environ.get("BOT_PASS_QUICK", "") bot_smart_pass = os.environ.get("BOT_PASS_SMART", "") -ensure_user(token, os.environ["SEEDER_USER"], os.environ["SEEDER_PASS"]) -ensure_user(token, os.environ["BOT_USER"], os.environ["BOT_PASS"]) -if bot_quick and bot_quick_pass: - ensure_user(token, bot_quick, bot_quick_pass) -if bot_smart and bot_smart_pass: - ensure_user(token, bot_smart, bot_smart_pass) + ensure_user(token, os.environ["SEEDER_USER"], os.environ["SEEDER_PASS"]) + ensure_user(token, os.environ["BOT_USER"], os.environ["BOT_PASS"]) + if bot_quick and bot_quick_pass: + ensure_user(token, bot_quick, bot_quick_pass) + if bot_smart and bot_smart_pass: + ensure_user(token, bot_smart, bot_smart_pass) PY