def get_cluster_state_dom(xml): try: dom = xml_fromstring(xml) if os.path.isfile(settings.crm_mon_schema): etree.RelaxNG(file=settings.crm_mon_schema).assertValid(dom) return dom except (etree.XMLSyntaxError, etree.DocumentInvalid): raise LibraryError(reports.cluster_state_invalid_format())
def get_cluster_state_dom(xml): try: dom = xml_fromstring(xml) if os.path.isfile(settings.crm_mon_schema): etree.RelaxNG(file=settings.crm_mon_schema).assertValid(dom) return dom except (etree.XMLSyntaxError, etree.DocumentInvalid): raise LibraryError(reports.cluster_state_invalid_format())