comms: fix MAS job indentation
This commit is contained in:
parent
88a4e93194
commit
cead8d3561
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user