示例#1
0
from PydoNovosoft.utils import Utils
from threading import Thread
from time import sleep
import os
import json_logging
import logging
import sys

json_logging.ENABLE_JSON_LOGGING = True
json_logging.init()

logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
logger.addHandler(logging.StreamHandler(sys.stdout))

config = Utils.read_config("package.json")
env_cfg = config[os.environ["environment"]]

if env_cfg["secrets"]:
    mzone_user = Utils.get_secret("centinelaz_user")
    mzone_pass = Utils.get_secret("centinelaz_pass")
    mzone_secret = Utils.get_secret("mzone_secret")
    centinela_token = Utils.get_secret("centinela_token")
    pghost = Utils.get_secret("pg_host")
    pguser = Utils.get_secret("pg_user")
    pgpass = Utils.get_secret("pg_pass")
else:
    mzone_user = env_cfg["mzone_user"]
    mzone_pass = env_cfg["mzone_pass"]
    mzone_secret = env_cfg["mzone_secret"]
    centinela_token = ""
示例#2
0
def main():
    print(Utils.print_title("package.json"))
    start(Utils.read_config("package.json"))