How to use the productmd.common.SortedConfigParser 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 pulp / pulp_rpm / pulp_rpm / app / kickstart / treeinfo.py View on Github external
def create_treeinfo(distribution_tree):
    """
    Create treeinfo file.

    Args:
        distirbution_tree(app.models.DistributionTree): a distirbution_tree object

    Returns:
        f(File): treeinfo file.

    """
    parser = SortedConfigParser()
    treeinfo = {}

    treeinfo["header"] = {
        "type": "productmd.treeinfo",
        "version": distribution_tree.header_version,
    }

    treeinfo["release"] = {
        "name": distribution_tree.release_name,
        "short": distribution_tree.release_short,
        "version": distribution_tree.release_version,
        "is_layered": distribution_tree.release_is_layered,
    }

    if distribution_tree.base_product_name:
        treeinfo["base_product"] = {
github pulp / pulp_rpm / pulp_rpm / app / kickstart / treeinfo.py View on Github external
def parsed_sections(self):
        """
        Treeinfo parsed data.

        """
        parser = SortedConfigParser()
        self.serialize(parser)

        if "general" in self.original_parser._sections:
            if "general" not in parser._sections:
                parser._sections["general"] = self.original_parser._sections["general"]

        return parser._sections