autopep8 and bump alpine
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Tobias Trabelsi
2023-04-21 14:39:06 +02:00
parent 4f92bfe86a
commit 3bb40cdcb4
7 changed files with 147 additions and 46 deletions

View File

@ -1,20 +1,20 @@
#!/usr/bin/env python3
import kopf
import os
import kopf
from utils.utils import command_wrapper, unlock_bw
@kopf.on.startup()
def bitwarden_signin(logger, **kwargs):
if 'BW_HOST' in os.environ:
try:
command_wrapper(f"config server {os.getenv('BW_HOST')}")
except:
except BaseException:
logger.warn("Revieved none zero exit code from server config")
logger.warn("This is expected from startup")
pass
else:
logger.info(f"BW_HOST not set. Assuming SaaS installation")
logger.info("BW_HOST not set. Assuming SaaS installation")
command_wrapper("login --apikey")
unlock_bw(logger)