예제 #1
0
 def setUp(self):
     self.env_assist, self.config = get_env_tools(self)
     self.config.env.set_known_hosts_dests(KNOWN_HOSTS_DESTS)
     cib_xml_man = XmlManipulation.from_file(rc("cib-empty.xml"))
     cib_xml_man.append_to_first_tag_name(
         "resources",
         """
             <primitive class="ocf" id="{0}"
                 provider="heartbeat" type="VirtualDomain"
             />
         """.format(VIRTUAL_MACHINE_ID)
     )
     self.config.env.set_cib_data(str(cib_xml_man))
예제 #2
0
파일: test_live.py 프로젝트: tomjelinek/pcs
 def fixture_status_xml(self, nodes, resources):
     xml_man = XmlManipulation.from_file(rc("crm_mon.minimal.xml"))
     doc = xml_man.tree.getroottree()
     doc.find("/summary/nodes_configured").set("number", str(nodes))
     doc.find("/summary/resources_configured").set("number", str(resources))
     return str(XmlManipulation(doc))
예제 #3
0
파일: test_live.py 프로젝트: zht750808/pcs
 def fixture_status_xml(self, nodes, resources):
     xml_man = XmlManipulation.from_file(rc("crm_mon.minimal.xml"))
     doc = xml_man.tree.getroottree()
     doc.find("/summary/nodes_configured").set("number", str(nodes))
     doc.find("/summary/resources_configured").set("number", str(resources))
     return str(XmlManipulation(doc))
예제 #4
0
 def set_cib_file(self, *xml_string_list):
     xml_manip = XmlManipulation.from_file(self.empty_cib)
     xml_manip.append_to_first_tag_name("resources", *xml_string_list)
     write_data_to_tmpfile(str(xml_manip), self.temp_cib)