Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __init__(self, params):
self.config = Config()
self.log = logging.getLogger(__name__)
self.log.info("config initialized")
self.database = Database(self.config)
self.log.info("database initialized")
self.params = params
if "defaults_hash" not in self.params:
self.params["defaults_hash"] = ""
if "defaults" in self.params:
if self.params["defaults"] != "":
self.params["defaults_hash"] = get_hash(self.params["defaults"], 32)
if not self.params["defaults_hash"]:
self.params["defaults_hash"] = ""
import json
import logging
import os
from http import HTTPStatus
import urllib.request
import yaml
from asu.build_request import BuildRequest
from asu.upgrade_check import UpgradeCheck
from asu.utils.config import Config
from asu.utils.common import get_packages_hash, get_request_hash
from asu.utils.database import Database
log = logging.getLogger(__name__)
config = Config()
database = Database(config)
uc = UpgradeCheck(config, database)
br = BuildRequest(config, database)
@app.route("/api/upgrade-check", methods=["POST"])
@app.route("/api/upgrade-check/", methods=["GET"])
def api_upgrade_check(request_hash=None):
if request.method == "POST":
try:
request_json = json.loads(request.get_data().decode("utf-8"))
except json.JSONDecodeError:
return "[]", HTTPStatus.BAD_REQUEST
else:
if not request_hash:
def __init__(self):
threading.Thread.__init__(self)
self.log = logging.getLogger(__name__)
self.config = Config()
self.database = Database(self.config)
self.build_queue = Queue(1)
def __init__(self):
threading.Thread.__init__(self)
self.log = logging.getLogger(__name__)
self.config = Config()
self.database = Database(self.config)
def __init__(self, location, job, queue):
self.location = location
self.queue = queue
self.job = job
threading.Thread.__init__(self)
self.log = logging.getLogger(__name__)
self.log.info("log initialized")
self.config = Config()
self.log.info("config initialized")
self.database = Database(self.config)
self.log.info("database initialized")
def __init__(self):
self.log = logging.getLogger(__name__)
self.config = Config()
self.database = Database(self.config)
self.init_args()
def __init__(self):
threading.Thread.__init__(self)
self.log = logging.getLogger(__name__)
self.config = Config()
self.database = Database(self.config)
self.update_queue = Queue(1)