本文整理汇总了Python中toscaparser.common.exception.ExceptionCollector.stop方法的典型用法代码示例。如果您正苦于以下问题:Python ExceptionCollector.stop方法的具体用法?Python ExceptionCollector.stop怎么用?Python ExceptionCollector.stop使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类toscaparser.common.exception.ExceptionCollector
的用法示例。
在下文中一共展示了ExceptionCollector.stop方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from toscaparser.common.exception import ExceptionCollector [as 别名]
# 或者: from toscaparser.common.exception.ExceptionCollector import stop [as 别名]
def __init__(self, path=None, parsed_params=None, a_file=True,
yaml_dict_tpl=None):
ExceptionCollector.start()
self.a_file = a_file
self.input_path = None
self.path = None
self.tpl = None
self.nested_tosca_tpls_with_topology = {}
self.nested_tosca_templates_with_topology = []
if path:
self.input_path = path
self.path = self._get_path(path)
if self.path:
self.tpl = YAML_LOADER(self.path, self.a_file)
if yaml_dict_tpl:
msg = (_('Both path and yaml_dict_tpl arguments were '
'provided. Using path and ignoring yaml_dict_tpl.'))
log.info(msg)
print(msg)
else:
if yaml_dict_tpl:
self.tpl = yaml_dict_tpl
else:
ExceptionCollector.appendException(
ValueError(_('No path or yaml_dict_tpl was provided. '
'There is nothing to parse.')))
if self.tpl:
self.parsed_params = parsed_params
self._validate_field()
self.version = self._tpl_version()
self.relationship_types = self._tpl_relationship_types()
self.description = self._tpl_description()
self.topology_template = self._topology_template()
self.repositories = self._tpl_repositories()
if self.topology_template.tpl:
self.inputs = self._inputs()
self.relationship_templates = self._relationship_templates()
self.nodetemplates = self._nodetemplates()
self.outputs = self._outputs()
self._handle_nested_tosca_templates_with_topology()
self.graph = ToscaGraph(self.nodetemplates)
ExceptionCollector.stop()
self.verify_template()
示例2: __init__
# 需要导入模块: from toscaparser.common.exception import ExceptionCollector [as 别名]
# 或者: from toscaparser.common.exception.ExceptionCollector import stop [as 别名]
def __init__(self, path, parsed_params=None, a_file=True):
ExceptionCollector.start()
self.a_file = a_file
self.input_path = path
self.path = self._get_path(path)
if self.path:
self.tpl = YAML_LOADER(self.path, self.a_file)
self.parsed_params = parsed_params
self._validate_field()
self.version = self._tpl_version()
self.relationship_types = self._tpl_relationship_types()
self.description = self._tpl_description()
self.topology_template = self._topology_template()
if self.topology_template.tpl:
self.inputs = self._inputs()
self.relationship_templates = self._relationship_templates()
self.nodetemplates = self._nodetemplates()
self.outputs = self._outputs()
self.graph = ToscaGraph(self.nodetemplates)
ExceptionCollector.stop()
self.verify_template()