Don't crash if don't find the Manifest.py

parent 7dcb132c
......@@ -274,7 +274,7 @@ types:[<type 'int'>]
if not os.path.exists(config_file):
raise RuntimeError("Config file doesn't exists: " + config_file)
self.config_file = config_file
return
return True
def add_prefix_code(self, code):
"""Add the arbitrary Python to be executed just before the Manifest"""
......
......@@ -283,8 +283,8 @@ class ManifestParser(ConfigParser):
return None
manifest = _search_for_manifest(path)
if manifest is None:
logging.error("No manifest found in path: %s", path)
quit()
logging.warning("No manifest found in path: %s", path)
return None
else:
logging.debug("Parse manifest in: %s", manifest)
return self.add_config_file(manifest)
......
......@@ -151,27 +151,32 @@ PARSE START: %s
manifest_parser.add_sufix_code(
self.pool.options.sufix_code)
manifest_parser.add_manifest(self.path)
parser_tmp = manifest_parser.add_manifest(self.path)
if self.parent is None:
extra_context = {}
if not parser_tmp == None:
if self.parent is None:
extra_context = {}
else:
extra_context = dict(self.top_module.manifest_dict)
extra_context["__manifest"] = self.path
# The parse method is where the most of the parser action takes place!
opt_map = None
try:
opt_map = manifest_parser.parse(extra_context=extra_context)
except NameError as name_error:
logging.error(
"Error while parsing {0}:\n{1}: {2}.".format(
self.path, type(name_error), name_error))
quit()
self.manifest_dict = opt_map
else:
extra_context = dict(self.top_module.manifest_dict)
extra_context["__manifest"] = self.path
# The parse method is where the most of the parser action takes place!
opt_map = None
try:
opt_map = manifest_parser.parse(extra_context=extra_context)
except NameError as name_error:
logging.error(
"Error while parsing {0}:\n{1}: {2}.".format(
self.path, type(name_error), name_error))
quit()
self.manifest_dict = opt_map
self.manifest_dict = {}
# Process the parsed manifest_dict to assign the module properties
self.process_manifest()
self.process_git_submodules()
# Parse every detected submodule
for module_aux in self.submodules():
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment