def read_update(self, config, view_yaml): with open(view_yaml, 'r') as yaml_file: yaml = yaml_file.read() self.log.debug(yaml) name, xml = convert_to_xml(yaml) self.log.debug(xml) update(config, name, xml)
def read_update(self, config, view_yaml): with open(view_yaml, 'r') as yaml_file: yaml = yaml_file.read() self.log.debug(yaml) try: xmls = convert_to_xml(yaml) except Exception as e: raise(e) if isinstance(xmls[0], str): name, xml = xmls self.log.debug(xml) update(config, name, xml) else: for name, xml in xmls: self.log.debug(xml) update(config, name, xml)
def read_update(self, config, view_yaml): with open(view_yaml, 'r') as yaml_file: yaml = yaml_file.read() self.log.debug(yaml) try: xmls = convert_to_xml(yaml) except Exception as e: raise (e) if isinstance(xmls[0], str): name, xml = xmls self.log.debug(xml) update(config, name, xml) else: for name, xml in xmls: self.log.debug(xml) update(config, name, xml)
def read_update(self, config, view_yaml): import io import six with io.open(view_yaml, 'r', encoding='utf-8') as yaml_file: _yaml = yaml_file.read() self.log.debug(_yaml) try: xmls = convert_to_xml(_yaml) except Exception as e: raise (e) if isinstance(xmls[0], six.string_types): name, xml = xmls self.log.debug(xml) update(config, name, xml) else: for name, xml in xmls: self.log.debug(xml) update(config, name, xml)