Chore: commit unstaged changed

main
Dorian Zedler 2023-09-10 12:17:13 +02:00
parent ccb91f3576
commit f6b054781a
Signed by: dozedler
GPG Key ID: 989DE36109AFA354
1 changed files with 8 additions and 2 deletions

View File

@ -25,12 +25,17 @@ class MlmMatrixBot:
self._config['MATRIX_SERVER'], self._matrixUsername, self._config['MATRIX_SPACE_ID'], self._matrixUsername)
async def init(self):
logging.info("==> Initializing <==")
logging.info(" \t* Connecting to ldap")
if not self._ldapHelper.bind():
return False
logging.info(" \t* Connecting to matrix")
if not await self._matrixHelper.login(self._config['MATRIX_PASSWORD']):
return False
logging.info("==> Initialized <==")
return True
async def run(self):
@ -182,7 +187,8 @@ class MlmMatrixBot:
if not rc:
return
labs = list(map(lambda lab: lab['sAMAccountName'].replace("p_", "").replace("lab", "-lab"), labs))
labs = list(map(lambda lab: lab['sAMAccountName'].replace(
"p_", "").replace("lab", "-lab"), labs))
await self._create_rooms(labs, joinable_for_space_members=True)
return labs
@ -264,7 +270,7 @@ async def main():
if not await bot.init():
logging.critical("Bot initialization failed")
sys.exit(1)
while True:
await bot.run()
time.sleep(60)