Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _clear(self):
"""Clear metadata repositories."""
self._tree_info = TreeInfo()
self._meta_repos = []
self._path = ""
"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:
def __init__(self):
self._tree_info = TreeInfo()
self._meta_repos = []
self._path = ""