Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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"] = {
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