예제 #1
0
    def process(self, yaml_string):
        """
        Processes a Yaml string. Custom tags are interpreted by 'process_' instance methods.
        """
        yaml_tag.add_constructors()

        is_preceded_by_comment = False
        for node in yaml.load(yaml_string):
            is_preceded_by_comment = self._log_node(node, is_preceded_by_comment)
            try:
                self._process_node(node)
            except Exception, e:
                _logger.exception(e)
                raise
예제 #2
0
    def process(self, yaml_string):
        """
        Processes a Yaml string. Custom tags are interpreted by 'process_' instance methods.
        """
        yaml_tag.add_constructors()

        is_preceded_by_comment = False
        for node in yaml.load(yaml_string):
            is_preceded_by_comment = self._log_node(node, is_preceded_by_comment)
            try:
                self._process_node(node)
            except Exception, e:
                _logger.exception(e)
                raise
예제 #3
0
    def process(self, yaml_string, fatal=False, **kwargs):
        """
        Processes a Yaml string. Custom tags are interpreted by `process_` instance methods.
        @param kwargs extra arguments, for future expansions. Ignored now.
        """
        yaml_tag.add_constructors()

        is_preceded_by_comment = False
        for node in yaml.load(yaml_string):
            is_preceded_by_comment = self._log(node, is_preceded_by_comment)
            try:
                self._process_node(node)
            except YamlImportException, e:
                self.logger.exception(misc.ustr(e))
                if fatal:
                    raise
            except Exception, e:
                self.logger.exception(misc.ustr(e))
                raise