Add additional error checking to get_module_modulemd

This commit is contained in:
Matt Prahl
2017-02-10 15:47:48 -05:00
parent 26c08f5e31
commit 08444ced95

View File

@@ -211,7 +211,10 @@ def get_module_modulemd(session, module_info, strict=False):
found. If strict=True, then a ValueError is raised.
:return: ModuleMetadata instance
"""
yaml = get_module(session, module_info, strict=strict)['modulemd']
yaml = None
module = get_module(session, module_info, strict=strict)
if module:
yaml = module['modulemd']
if not yaml:
if strict:
raise ValueError("Failed to find modulemd entry in PDC for "