How to use the productmd.treeinfo.TreeInfo function in productmd

To help you get started, we’ve selected a few productmd 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 rhinstaller / anaconda / pyanaconda / payload / install_tree_metadata.py View on Github external
def _clear(self):
        """Clear metadata repositories."""
        self._tree_info = TreeInfo()
        self._meta_repos = []
        self._path = ""
github pulp / pulp_rpm / pulp_rpm / app / kickstart / treeinfo.py View on Github external
"platforms": treeinfo["tree"]["platforms"],
        "packagedir": first_variant["packages"],
        "repository": first_variant["repository"],
        "timestamp": treeinfo["tree"]["build_timestamp"],
        "variant": first_variant["uid"],
    }

    parser.read_dict(treeinfo)

    with open(".treeinfo", "w") as f:
        parser.write(f)

    return f


class PulpTreeInfo(TreeInfo):
    """
    Extend TreeInfo for handling errors.

    """

    def deserialize(self, parser):
        """
        Handle errors on deserialize TreeInfo.

        """
        try:
            super().deserialize(parser)
        except Exception:
            sections = parser._sections.keys()

            for section in sections:
github rhinstaller / anaconda / pyanaconda / payload / install_tree_metadata.py View on Github external
def __init__(self):
        self._tree_info = TreeInfo()
        self._meta_repos = []
        self._path = ""