Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
"xz-utils",
"zlib-dev",
]
packages_hash = get_packages_hash(packages)
database.insert_packages_hash(packages_hash, packages)
params = {
"distro": "openwrt",
"version": config.get("openwrt").get("latest"),
"target": "x86/64",
"profile": "Generic",
"packages_hash": packages_hash,
}
params["request_hash"] = get_request_hash(params)
database.insert_dict("requests", params)
self.response_status = HTTPStatus.NOT_FOUND
return self.respond()
else:
return self.return_status()
# TODO check for profile or board
# generic approach for
# https://github.com/aparcar/attendedsysupgrade-server/issues/91
self.request_json["board"] = self.request_json["board"].replace(",", "_")
self.request_json["profile"] = self.request_json[
"board"
] # TODO fix this workaround
request_hash = get_request_hash(self.request_json)
request_database = self.database.check_request_hash(request_hash)
# if found return instantly the status
if request_database:
self.log.debug(
"found image in database: %s", request_database["request_status"]
)
self.request = request_database
return self.return_status()
else:
self.request["request_hash"] = request_hash
self.response_json["request_hash"] = self.request["request_hash"]
# if not perform various checks to see if the request is acutally valid
# validate distro and version
def build_all():
"""Build all profiles of openwrt latest stable"""
for profile in database.get_all_profiles(
"openwrt", config.get("openwrt").get("latest")
):
target, profile = profile
params = {
"distro": "openwrt",
"version": config.get("openwrt").get("latest"),
"target": target,
"profile": profile,
}
params["request_hash"] = get_request_hash(params)
database.insert_dict("requests", params)