How to use the asu.utils.common.get_packages_hash function in asu

To help you get started, we’ve selected a few asu examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github aparcar / attendedsysupgrade-server / asu / views.py View on Github external
"perlbase-findbin",
        "perlbase-getopt",
        "perlbase-thread",
        "python-light",
        "tar",
        "unzip",
        "wget",
        "xz",
        "xzdiff",
        "xzgrep",
        "xzless",
        "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)
github aparcar / attendedsysupgrade-server / asu / build_request.py View on Github external
self.respond()
                else:
                    self.request["defaults_hash"] = get_hash(
                        self.request_json["defaults"], 32
                    )
                    self.database.insert_defaults(
                        self.request["defaults_hash"], self.request_json["defaults"]
                    )

        # add package_hash to database
        if "packages" in self.request_json:
            # check for existing packages
            bad_packages = self.check_bad_packages(self.request_json["packages"])
            if bad_packages:
                return bad_packages
            self.request["packages_hash"] = get_packages_hash(
                self.request_json["packages"]
            )
            self.database.insert_packages_hash(
                self.request["packages_hash"], self.request["packages"]
            )

        # now some heavy guess work is done to figure out the profile
        # eventually this could be simplified if upstream unifirm the
        # profiles/boards
        if "board" in self.request_json:
            self.log.debug(
                "board in request, search for %s", self.request_json["board"]
            )
            self.request["profile"] = self.database.check_profile(
                self.request["distro"],
                self.request["version"],