xmlbuilder: Rename get_xml_config -> get_xml

The config part is redundant. Should have done this a long time ago
This commit is contained in:
Cole Robinson 2018-08-31 16:52:02 -04:00
parent 2b41e130d8
commit ea413be214
21 changed files with 117 additions and 117 deletions

View File

@ -93,7 +93,7 @@ class TestClone(unittest.TestCase):
if clone_disks_file: if clone_disks_file:
xml_clone_disks = "" xml_clone_disks = ""
for i in cloneobj.clone_disks: for i in cloneobj.clone_disks:
xml_clone_disks += i.get_vol_install().get_xml_config() xml_clone_disks += i.get_vol_install().get_xml()
utils.diff_compare(xml_clone_disks, clone_disks_file) utils.diff_compare(xml_clone_disks, clone_disks_file)
def _clone_define(self, filebase): def _clone_define(self, filebase):

View File

@ -51,7 +51,7 @@ class TestInterfaces(unittest.TestCase):
def define_xml(self, obj, compare=True): def define_xml(self, obj, compare=True):
obj.validate() obj.validate()
xml = obj.get_xml_config() xml = obj.get_xml()
logging.debug("Defining interface XML:\n%s", xml) logging.debug("Defining interface XML:\n%s", xml)
if compare: if compare:

View File

@ -85,7 +85,7 @@ class TestNodeDev(unittest.TestCase):
dev = DeviceHostdev(self.conn) dev = DeviceHostdev(self.conn)
dev.set_from_nodedev(nodedev) dev.set_from_nodedev(nodedev)
utils.diff_compare(dev.get_xml_config() + "\n", devfile) utils.diff_compare(dev.get_xml() + "\n", devfile)
def testSystemDevice(self): def testSystemDevice(self):
devname = "computer" devname = "computer"

View File

@ -52,7 +52,7 @@ def removePool(poolobj):
def poolCompare(pool_inst): def poolCompare(pool_inst):
filename = os.path.join(basepath, pool_inst.name + ".xml") filename = os.path.join(basepath, pool_inst.name + ".xml")
out_expect = pool_inst.get_xml_config() out_expect = pool_inst.get_xml()
if not os.path.exists(filename): if not os.path.exists(filename):
open(filename, "w").write(out_expect) open(filename, "w").write(out_expect)
@ -93,7 +93,7 @@ def createVol(conn, poolobj, volname=None, input_vol=None, clone_vol=None):
vol_inst.validate() vol_inst.validate()
filename = os.path.join(basepath, vol_inst.name + ".xml") filename = os.path.join(basepath, vol_inst.name + ".xml")
utils.diff_compare(vol_inst.get_xml_config(), filename) utils.diff_compare(vol_inst.get_xml(), filename)
return vol_inst.install(meter=False) return vol_inst.install(meter=False)

View File

@ -132,27 +132,27 @@ class TestXMLMisc(unittest.TestCase):
dev1.macaddr = "22:22:33:44:55:66" dev1.macaddr = "22:22:33:44:55:66"
dev2 = virtinst.DeviceInterface(self.conn, dev2 = virtinst.DeviceInterface(self.conn,
parsexml=dev1.get_xml_config()) parsexml=dev1.get_xml())
dev2.source = None dev2.source = None
dev2.source = "foobr0" dev2.source = "foobr0"
dev2.macaddr = "22:22:33:44:55:67" dev2.macaddr = "22:22:33:44:55:67"
dev3 = virtinst.DeviceInterface(self.conn, dev3 = virtinst.DeviceInterface(self.conn,
parsexml=dev1.get_xml_config()) parsexml=dev1.get_xml())
dev3.source = None dev3.source = None
dev3.macaddr = "22:22:33:44:55:68" dev3.macaddr = "22:22:33:44:55:68"
utils.diff_compare(dev1.get_xml_config(), None, utils.diff_compare(dev1.get_xml(), None,
"<interface type=\"bridge\">\n" "<interface type=\"bridge\">\n"
" <source bridge=\"bzz0\"/>\n" " <source bridge=\"bzz0\"/>\n"
" <mac address=\"22:22:33:44:55:66\"/>\n" " <mac address=\"22:22:33:44:55:66\"/>\n"
"</interface>\n") "</interface>\n")
utils.diff_compare(dev2.get_xml_config(), None, utils.diff_compare(dev2.get_xml(), None,
"<interface type=\"bridge\">\n" "<interface type=\"bridge\">\n"
" <source bridge=\"foobr0\"/>\n" " <source bridge=\"foobr0\"/>\n"
" <mac address=\"22:22:33:44:55:67\"/>\n" " <mac address=\"22:22:33:44:55:67\"/>\n"
"</interface>\n") "</interface>\n")
utils.diff_compare(dev3.get_xml_config(), None, utils.diff_compare(dev3.get_xml(), None,
"<interface type=\"bridge\">\n" "<interface type=\"bridge\">\n"
" <mac address=\"22:22:33:44:55:68\"/>\n" " <mac address=\"22:22:33:44:55:68\"/>\n"
"</interface>\n") "</interface>\n")

View File

@ -34,7 +34,7 @@ class XMLParseTest(unittest.TestCase):
def _roundtrip_compare(self, filename): def _roundtrip_compare(self, filename):
expectXML = sanitize_file_xml(open(filename).read()) expectXML = sanitize_file_xml(open(filename).read())
guest = virtinst.Guest(self.conn, parsexml=expectXML) guest = virtinst.Guest(self.conn, parsexml=expectXML)
actualXML = guest.get_xml_config() actualXML = guest.get_xml()
utils.diff_compare(actualXML, expect_out=expectXML) utils.diff_compare(actualXML, expect_out=expectXML)
def _alter_compare(self, actualXML, outfile, support_check=None): def _alter_compare(self, actualXML, outfile, support_check=None):
@ -179,7 +179,7 @@ class XMLParseTest(unittest.TestCase):
check("policy", "force", "disable") check("policy", "force", "disable")
rmfeat = guest.cpu.features[3] rmfeat = guest.cpu.features[3]
guest.cpu.remove_child(rmfeat) guest.cpu.remove_child(rmfeat)
self.assertEqual(rmfeat.get_xml_config(), self.assertEqual(rmfeat.get_xml(),
"""<feature name="foo" policy="bar"/>\n""") """<feature name="foo" policy="bar"/>\n""")
guest.cpu.add_feature("addfeature") guest.cpu.add_feature("addfeature")
@ -220,7 +220,7 @@ class XMLParseTest(unittest.TestCase):
check("nosharepages", False, True) check("nosharepages", False, True)
check("locked", False, True) check("locked", False, True)
self._alter_compare(guest.get_xml_config(), outfile, self._alter_compare(guest.get_xml(), outfile,
support_check=[self.conn.SUPPORT_CONN_VMPORT, support_check=[self.conn.SUPPORT_CONN_VMPORT,
self.conn.SUPPORT_CONN_VMCOREINFO]) self.conn.SUPPORT_CONN_VMCOREINFO])
@ -237,7 +237,7 @@ class XMLParseTest(unittest.TestCase):
guest.remove_child(guest.seclabels[1]) guest.remove_child(guest.seclabels[1])
self._alter_compare(guest.get_xml_config(), outfile) self._alter_compare(guest.get_xml(), outfile)
def testAlterMinimalGuest(self): def testAlterMinimalGuest(self):
guest, outfile = self._get_test_content("change-minimal-guest") guest, outfile = self._get_test_content("change-minimal-guest")
@ -246,11 +246,11 @@ class XMLParseTest(unittest.TestCase):
check("acpi", False, True) check("acpi", False, True)
check("pae", False) check("pae", False)
self.assertTrue( self.assertTrue(
guest.features.get_xml_config().startswith("<features")) guest.features.get_xml().startswith("<features"))
check = self._make_checker(guest.clock) check = self._make_checker(guest.clock)
check("offset", None, "utc") check("offset", None, "utc")
self.assertTrue(guest.clock.get_xml_config().startswith("<clock")) self.assertTrue(guest.clock.get_xml().startswith("<clock"))
seclabel = virtinst.DomainSeclabel(guest.conn) seclabel = virtinst.DomainSeclabel(guest.conn)
guest.add_child(seclabel) guest.add_child(seclabel)
@ -258,7 +258,7 @@ class XMLParseTest(unittest.TestCase):
seclabel.type = "static" seclabel.type = "static"
seclabel.label = "frob" seclabel.label = "frob"
self.assertTrue( self.assertTrue(
guest.seclabels[0].get_xml_config().startswith("<seclabel")) guest.seclabels[0].get_xml().startswith("<seclabel"))
check = self._make_checker(guest.cpu) check = self._make_checker(guest.cpu)
check("model", None, "foobar") check("model", None, "foobar")
@ -266,15 +266,15 @@ class XMLParseTest(unittest.TestCase):
check("cores", None, 4) check("cores", None, 4)
guest.cpu.add_feature("x2apic", "forbid") guest.cpu.add_feature("x2apic", "forbid")
guest.cpu.set_topology_defaults(guest.vcpus) guest.cpu.set_topology_defaults(guest.vcpus)
self.assertTrue(guest.cpu.get_xml_config().startswith("<cpu")) self.assertTrue(guest.cpu.get_xml().startswith("<cpu"))
self.assertEqual(guest.cpu.get_xml_id(), "./cpu") self.assertEqual(guest.cpu.get_xml_id(), "./cpu")
self.assertEqual(guest.cpu.get_xml_idx(), 0) self.assertEqual(guest.cpu.get_xml_idx(), 0)
self.assertEqual(guest.get_xml_id(), ".") self.assertEqual(guest.get_xml_id(), ".")
self.assertEqual(guest.get_xml_idx(), 0) self.assertEqual(guest.get_xml_idx(), 0)
self.assertTrue(guest.os.get_xml_config().startswith("<os")) self.assertTrue(guest.os.get_xml().startswith("<os"))
self._alter_compare(guest.get_xml_config(), outfile) self._alter_compare(guest.get_xml(), outfile)
def testAlterBootMulti(self): def testAlterBootMulti(self):
guest, outfile = self._get_test_content("change-boot-multi") guest, outfile = self._get_test_content("change-boot-multi")
@ -287,7 +287,7 @@ class XMLParseTest(unittest.TestCase):
check("dtb", None, "/baz.dtb") check("dtb", None, "/baz.dtb")
check("kernel_args", None, "ks=foo.ks") check("kernel_args", None, "ks=foo.ks")
self._alter_compare(guest.get_xml_config(), outfile) self._alter_compare(guest.get_xml(), outfile)
def testAlterBootKernel(self): def testAlterBootKernel(self):
guest, outfile = self._get_test_content("change-boot-kernel") guest, outfile = self._get_test_content("change-boot-kernel")
@ -300,7 +300,7 @@ class XMLParseTest(unittest.TestCase):
check("initrd", "/boot/initrd", None) check("initrd", "/boot/initrd", None)
check("kernel_args", "location", None) check("kernel_args", "location", None)
self._alter_compare(guest.get_xml_config(), outfile) self._alter_compare(guest.get_xml(), outfile)
def testAlterBootUEFI(self): def testAlterBootUEFI(self):
guest, outfile = self._get_test_content("change-boot-uefi") guest, outfile = self._get_test_content("change-boot-uefi")
@ -318,7 +318,7 @@ class XMLParseTest(unittest.TestCase):
check("initrd", "/boot/initrd", None) check("initrd", "/boot/initrd", None)
check("kernel_args", "location", None) check("kernel_args", "location", None)
self._alter_compare(guest.get_xml_config(), outfile) self._alter_compare(guest.get_xml(), outfile)
def testAlterCpuMode(self): def testAlterCpuMode(self):
guest, outfile = self._get_test_content("change-cpumode") guest, outfile = self._get_test_content("change-cpumode")
@ -329,7 +329,7 @@ class XMLParseTest(unittest.TestCase):
# mode will be "custom" # mode will be "custom"
check("model", None, "qemu64") check("model", None, "qemu64")
self._alter_compare(guest.get_xml_config(), outfile) self._alter_compare(guest.get_xml(), outfile)
def testAlterDisk(self): def testAlterDisk(self):
""" """
@ -419,14 +419,14 @@ class XMLParseTest(unittest.TestCase):
check("source_host_socket", "/var/run/nbdsock") check("source_host_socket", "/var/run/nbdsock")
check("path", "nbd+unix:///var/run/nbdsock") check("path", "nbd+unix:///var/run/nbdsock")
self._alter_compare(guest.get_xml_config(), outfile) self._alter_compare(guest.get_xml(), outfile)
def testSingleDisk(self): def testSingleDisk(self):
xml = ("""<disk type="file" device="disk"><source file="/a.img"/>\n""" xml = ("""<disk type="file" device="disk"><source file="/a.img"/>\n"""
"""<target dev="hda" bus="ide"/></disk>\n""") """<target dev="hda" bus="ide"/></disk>\n""")
d = virtinst.DeviceDisk(self.conn, parsexml=xml) d = virtinst.DeviceDisk(self.conn, parsexml=xml)
self._set_and_check(d, "target", "hda", "hdb") self._set_and_check(d, "target", "hda", "hdb")
self.assertEqual(xml.replace("hda", "hdb"), d.get_xml_config()) self.assertEqual(xml.replace("hda", "hdb"), d.get_xml())
def testAlterChars(self): def testAlterChars(self):
guest, outfile = self._get_test_content("change-chars") guest, outfile = self._get_test_content("change-chars")
@ -495,7 +495,7 @@ class XMLParseTest(unittest.TestCase):
self.assertEqual(channel3.get_xml_id(), "./devices/channel[3]") self.assertEqual(channel3.get_xml_id(), "./devices/channel[3]")
self.assertEqual(channel3.get_xml_idx(), 2) self.assertEqual(channel3.get_xml_idx(), 2)
self._alter_compare(guest.get_xml_config(), outfile) self._alter_compare(guest.get_xml(), outfile)
def testAlterControllers(self): def testAlterControllers(self):
guest, outfile = self._get_test_content("change-controllers") guest, outfile = self._get_test_content("change-controllers")
@ -525,7 +525,7 @@ class XMLParseTest(unittest.TestCase):
check("model", "ich9-ehci1", "ich9-uhci1") check("model", "ich9-ehci1", "ich9-uhci1")
check("master_startport", 4, 2) check("master_startport", 4, 2)
self._alter_compare(guest.get_xml_config(), outfile) self._alter_compare(guest.get_xml(), outfile)
def testAlterNics(self): def testAlterNics(self):
guest, outfile = self._get_test_content("change-nics") guest, outfile = self._get_test_content("change-nics")
@ -577,7 +577,7 @@ class XMLParseTest(unittest.TestCase):
check("instanceid", "09b11c53-8b5c-4eeb-8f00-d84eaa0aaa3b", check("instanceid", "09b11c53-8b5c-4eeb-8f00-d84eaa0aaa3b",
"09b11c53-8b5c-4eeb-8f00-d84eaa0aaa4f") "09b11c53-8b5c-4eeb-8f00-d84eaa0aaa4f")
self._alter_compare(guest.get_xml_config(), outfile) self._alter_compare(guest.get_xml(), outfile)
def testAlterInputs(self): def testAlterInputs(self):
guest, outfile = self._get_test_content("change-inputs") guest, outfile = self._get_test_content("change-inputs")
@ -594,7 +594,7 @@ class XMLParseTest(unittest.TestCase):
check("bus", "usb", "xen") check("bus", "usb", "xen")
check("bus", "xen", "usb") check("bus", "xen", "usb")
self._alter_compare(guest.get_xml_config(), outfile) self._alter_compare(guest.get_xml(), outfile)
def testAlterGraphics(self): def testAlterGraphics(self):
guest, outfile = self._get_test_content("change-graphics") guest, outfile = self._get_test_content("change-graphics")
@ -659,7 +659,7 @@ class XMLParseTest(unittest.TestCase):
check("gl", None, True) check("gl", None, True)
check("rendernode", None, "/dev/dri/foo") check("rendernode", None, "/dev/dri/foo")
self._alter_compare(guest.get_xml_config(), outfile) self._alter_compare(guest.get_xml(), outfile)
def testAlterVideos(self): def testAlterVideos(self):
guest, outfile = self._get_test_content("change-videos") guest, outfile = self._get_test_content("change-videos")
@ -684,7 +684,7 @@ class XMLParseTest(unittest.TestCase):
check("vgamem", None, 8192) check("vgamem", None, 8192)
check("accel3d", None, True) check("accel3d", None, True)
self._alter_compare(guest.get_xml_config(), outfile) self._alter_compare(guest.get_xml(), outfile)
def testAlterHostdevs(self): def testAlterHostdevs(self):
infile = "tests/xmlparse-xml/change-hostdevs-in.xml" infile = "tests/xmlparse-xml/change-hostdevs-in.xml"
@ -745,7 +745,7 @@ class XMLParseTest(unittest.TestCase):
check = self._make_checker(dev7) check = self._make_checker(dev7)
check("type", "storage") check("type", "storage")
check("storage_block", "/dev/sdf", "/dev/fd0") check("storage_block", "/dev/sdf", "/dev/fd0")
self._alter_compare(guest.get_xml_config(), outfile) self._alter_compare(guest.get_xml(), outfile)
def testAlterWatchdogs(self): def testAlterWatchdogs(self):
guest, outfile = self._get_test_content("change-watchdogs") guest, outfile = self._get_test_content("change-watchdogs")
@ -755,7 +755,7 @@ class XMLParseTest(unittest.TestCase):
check("model", "ib700", "i6300esb") check("model", "ib700", "i6300esb")
check("action", "none", "poweroff") check("action", "none", "poweroff")
self._alter_compare(guest.get_xml_config(), outfile) self._alter_compare(guest.get_xml(), outfile)
def testAlterFilesystems(self): def testAlterFilesystems(self):
guest, outfile = self._get_test_content("change-filesystems") guest, outfile = self._get_test_content("change-filesystems")
@ -814,7 +814,7 @@ class XMLParseTest(unittest.TestCase):
check("source", "/foo/bar.img", "/foo/bar.raw") check("source", "/foo/bar.img", "/foo/bar.raw")
check("readonly", False, True) check("readonly", False, True)
self._alter_compare(guest.get_xml_config(), outfile) self._alter_compare(guest.get_xml(), outfile)
def testAlterSounds(self): def testAlterSounds(self):
infile = "tests/xmlparse-xml/change-sounds-in.xml" infile = "tests/xmlparse-xml/change-sounds-in.xml"
@ -835,7 +835,7 @@ class XMLParseTest(unittest.TestCase):
check = self._make_checker(dev3) check = self._make_checker(dev3)
check("model", "ac97", "sb16") check("model", "ac97", "sb16")
self._alter_compare(guest.get_xml_config(), outfile) self._alter_compare(guest.get_xml(), outfile)
def testAlterAddr(self): def testAlterAddr(self):
guest, outfile = self._get_test_content("change-addr") guest, outfile = self._get_test_content("change-addr")
@ -885,7 +885,7 @@ class XMLParseTest(unittest.TestCase):
# memory devices? # memory devices?
guest.remove_device(dev5) guest.remove_device(dev5)
self._alter_compare(guest.get_xml_config(), outfile) self._alter_compare(guest.get_xml(), outfile)
def testAlterSmartCard(self): def testAlterSmartCard(self):
guest, outfile = self._get_test_content("change-smartcard") guest, outfile = self._get_test_content("change-smartcard")
@ -900,7 +900,7 @@ class XMLParseTest(unittest.TestCase):
check("mode", "passthrough", "host") check("mode", "passthrough", "host")
check("type", "spicevmc", None) check("type", "spicevmc", None)
self._alter_compare(guest.get_xml_config(), outfile) self._alter_compare(guest.get_xml(), outfile)
def testAlterRedirdev(self): def testAlterRedirdev(self):
guest, outfile = self._get_test_content("change-redirdev") guest, outfile = self._get_test_content("change-redirdev")
@ -916,7 +916,7 @@ class XMLParseTest(unittest.TestCase):
check = self._make_checker(dev2) check = self._make_checker(dev2)
check("type", "tcp", "spicevmc") check("type", "tcp", "spicevmc")
self._alter_compare(guest.get_xml_config(), outfile) self._alter_compare(guest.get_xml(), outfile)
def testAlterTPM(self): def testAlterTPM(self):
guest, outfile = self._get_test_content("change-tpm") guest, outfile = self._get_test_content("change-tpm")
@ -928,7 +928,7 @@ class XMLParseTest(unittest.TestCase):
check("model", "tpm-tis", "tpm-crb", "tpm-tis") check("model", "tpm-tis", "tpm-crb", "tpm-tis")
check("device_path", "/dev/tpm0", "frob") check("device_path", "/dev/tpm0", "frob")
self._alter_compare(guest.get_xml_config(), outfile) self._alter_compare(guest.get_xml(), outfile)
def testAlterRNG_EGD(self): def testAlterRNG_EGD(self):
guest, outfile = self._get_test_content("change-rng-egd") guest, outfile = self._get_test_content("change-rng-egd")
@ -947,7 +947,7 @@ class XMLParseTest(unittest.TestCase):
check("rate_bytes", "1234", "4321") check("rate_bytes", "1234", "4321")
check("rate_period", "2000", "2001") check("rate_period", "2000", "2001")
self._alter_compare(guest.get_xml_config(), outfile) self._alter_compare(guest.get_xml(), outfile)
def testAlterRNG_Random(self): def testAlterRNG_Random(self):
guest, outfile = self._get_test_content("change-rng-random") guest, outfile = self._get_test_content("change-rng-random")
@ -959,7 +959,7 @@ class XMLParseTest(unittest.TestCase):
check("model", "virtio", "virtio") check("model", "virtio", "virtio")
check("device", "/dev/random", "/dev/hwrng") check("device", "/dev/random", "/dev/hwrng")
self._alter_compare(guest.get_xml_config(), outfile) self._alter_compare(guest.get_xml(), outfile)
def testConsoleCompat(self): def testConsoleCompat(self):
guest, outfile = self._get_test_content("console-compat") guest, outfile = self._get_test_content("console-compat")
@ -969,7 +969,7 @@ class XMLParseTest(unittest.TestCase):
check("source_path", "/dev/pts/4") check("source_path", "/dev/pts/4")
check("_tty", "/dev/pts/4", "foo", "/dev/pts/4") check("_tty", "/dev/pts/4", "foo", "/dev/pts/4")
self._alter_compare(guest.get_xml_config(), outfile) self._alter_compare(guest.get_xml(), outfile)
def testPanicDevice(self): def testPanicDevice(self):
guest, outfile = self._get_test_content("change-panic-device") guest, outfile = self._get_test_content("change-panic-device")
@ -979,7 +979,7 @@ class XMLParseTest(unittest.TestCase):
check = self._make_checker(dev1) check = self._make_checker(dev1)
check("type", "isa", None, "isa") check("type", "isa", None, "isa")
check("iobase", "0x505", None, "0x506") check("iobase", "0x505", None, "0x506")
self._alter_compare(guest.get_xml_config(), outfile) self._alter_compare(guest.get_xml(), outfile)
def testQEMUXMLNS(self): def testQEMUXMLNS(self):
basename = "change-xmlns-qemu" basename = "change-xmlns-qemu"
@ -994,7 +994,7 @@ class XMLParseTest(unittest.TestCase):
guest.xmlns_qemu.args.add_new().value = "additional-arg" guest.xmlns_qemu.args.add_new().value = "additional-arg"
arg0 = guest.xmlns_qemu.args[0] arg0 = guest.xmlns_qemu.args[0]
guest.xmlns_qemu.remove_child(guest.xmlns_qemu.args[0]) guest.xmlns_qemu.remove_child(guest.xmlns_qemu.args[0])
self.assertEqual(arg0.get_xml_config(), self.assertEqual(arg0.get_xml(),
"<qemu:arg xmlns:qemu=\"http://libvirt.org/schemas/domain/qemu/1.0\" value=\"-somenewarg\"/>\n") "<qemu:arg xmlns:qemu=\"http://libvirt.org/schemas/domain/qemu/1.0\" value=\"-somenewarg\"/>\n")
check = self._make_checker(guest.xmlns_qemu.envs[0]) check = self._make_checker(guest.xmlns_qemu.envs[0])
@ -1004,7 +1004,7 @@ class XMLParseTest(unittest.TestCase):
env.name = "DISPLAY" env.name = "DISPLAY"
env.value = "1:2" env.value = "1:2"
self._alter_compare(guest.get_xml_config(), outfile) self._alter_compare(guest.get_xml(), outfile)
def testAddRemoveDevices(self): def testAddRemoveDevices(self):
guest, outfile = self._get_test_content("add-devices") guest, outfile = self._get_test_content("add-devices")
@ -1032,7 +1032,7 @@ class XMLParseTest(unittest.TestCase):
guest.add_device(virtinst.DeviceSound(self.conn, guest.add_device(virtinst.DeviceSound(self.conn,
parsexml="""<sound model='pcspk'/>""")) parsexml="""<sound model='pcspk'/>"""))
self._alter_compare(guest.get_xml_config(), outfile) self._alter_compare(guest.get_xml(), outfile)
def testChangeKVMMedia(self): def testChangeKVMMedia(self):
guest, outfile = self._get_test_content("change-media", kvm=True) guest, outfile = self._get_test_content("change-media", kvm=True)
@ -1063,7 +1063,7 @@ class XMLParseTest(unittest.TestCase):
check("path", None, "/dev/disk-pool/diskvol1") check("path", None, "/dev/disk-pool/diskvol1")
disk.sync_path_props() disk.sync_path_props()
self._alter_compare(guest.get_xml_config(), outfile) self._alter_compare(guest.get_xml(), outfile)
def testChangeSnapshot(self): def testChangeSnapshot(self):
basename = "change-snapshot" basename = "change-snapshot"
@ -1083,7 +1083,7 @@ class XMLParseTest(unittest.TestCase):
check("name", "hda", "hdb") check("name", "hda", "hdb")
check("snapshot", "internal", "no") check("snapshot", "internal", "no")
utils.diff_compare(snap.get_xml_config(), outfile) utils.diff_compare(snap.get_xml(), outfile)
################### ###################
@ -1127,8 +1127,8 @@ class XMLParseTest(unittest.TestCase):
check("name", "bond-brbond") check("name", "bond-brbond")
self.assertEqual(len(child_iface.interfaces), 2) self.assertEqual(len(child_iface.interfaces), 2)
utils.diff_compare(iface.get_xml_config(), outfile) utils.diff_compare(iface.get_xml(), outfile)
utils.test_create(self.conn, iface.get_xml_config(), "interfaceDefineXML") utils.test_create(self.conn, iface.get_xml(), "interfaceDefineXML")
def testInterfaceBondArp(self): def testInterfaceBondArp(self):
basename = "test-bond-arp" basename = "test-bond-arp"
@ -1146,8 +1146,8 @@ class XMLParseTest(unittest.TestCase):
check("arp_target", "192.168.100.200", "1.2.3.4") check("arp_target", "192.168.100.200", "1.2.3.4")
check("arp_validate_mode", "backup", "active") check("arp_validate_mode", "backup", "active")
utils.diff_compare(iface.get_xml_config(), outfile) utils.diff_compare(iface.get_xml(), outfile)
utils.test_create(self.conn, iface.get_xml_config(), "interfaceDefineXML") utils.test_create(self.conn, iface.get_xml(), "interfaceDefineXML")
def testInterfaceBondMii(self): def testInterfaceBondMii(self):
basename = "test-bond-mii" basename = "test-bond-mii"
@ -1161,8 +1161,8 @@ class XMLParseTest(unittest.TestCase):
check("mii_updelay", 12, 33) check("mii_updelay", 12, 33)
check("mii_carrier_mode", "netif", "ioctl") check("mii_carrier_mode", "netif", "ioctl")
utils.diff_compare(iface.get_xml_config(), outfile) utils.diff_compare(iface.get_xml(), outfile)
utils.test_create(self.conn, iface.get_xml_config(), "interfaceDefineXML") utils.test_create(self.conn, iface.get_xml(), "interfaceDefineXML")
def testInterfaceVLAN(self): def testInterfaceVLAN(self):
basename = "test-vlan" basename = "test-vlan"
@ -1174,8 +1174,8 @@ class XMLParseTest(unittest.TestCase):
check("tag", 123, 456) check("tag", 123, 456)
check("parent_interface", "eth2", "foonew") check("parent_interface", "eth2", "foonew")
utils.diff_compare(iface.get_xml_config(), outfile) utils.diff_compare(iface.get_xml(), outfile)
utils.test_create(self.conn, iface.get_xml_config(), "interfaceDefineXML") utils.test_create(self.conn, iface.get_xml(), "interfaceDefineXML")
################# #################
@ -1202,8 +1202,8 @@ class XMLParseTest(unittest.TestCase):
check("target_path", "/some/target/path", "/mnt/my/foo") check("target_path", "/some/target/path", "/mnt/my/foo")
check("source_name", None, "fooname") check("source_name", None, "fooname")
utils.diff_compare(pool.get_xml_config(), outfile) utils.diff_compare(pool.get_xml(), outfile)
utils.test_create(self.conn, pool.get_xml_config(), "storagePoolDefineXML") utils.test_create(self.conn, pool.get_xml(), "storagePoolDefineXML")
def testISCSIPool(self): def testISCSIPool(self):
basename = "pool-iscsi" basename = "pool-iscsi"
@ -1216,8 +1216,8 @@ class XMLParseTest(unittest.TestCase):
check = self._make_checker(pool.hosts[0]) check = self._make_checker(pool.hosts[0])
check("name", "some.random.hostname", "my.host") check("name", "some.random.hostname", "my.host")
utils.diff_compare(pool.get_xml_config(), outfile) utils.diff_compare(pool.get_xml(), outfile)
utils.test_create(self.conn, pool.get_xml_config(), "storagePoolDefineXML") utils.test_create(self.conn, pool.get_xml(), "storagePoolDefineXML")
def testGlusterPool(self): def testGlusterPool(self):
if not self.conn.check_support(self.conn.SUPPORT_CONN_POOL_GLUSTERFS): if not self.conn.check_support(self.conn.SUPPORT_CONN_POOL_GLUSTERFS):
@ -1234,8 +1234,8 @@ class XMLParseTest(unittest.TestCase):
check = self._make_checker(pool.hosts[0]) check = self._make_checker(pool.hosts[0])
check("name", "some.random.hostname", "my.host") check("name", "some.random.hostname", "my.host")
utils.diff_compare(pool.get_xml_config(), outfile) utils.diff_compare(pool.get_xml(), outfile)
utils.test_create(self.conn, pool.get_xml_config(), "storagePoolDefineXML") utils.test_create(self.conn, pool.get_xml(), "storagePoolDefineXML")
def testRBDPool(self): def testRBDPool(self):
basename = "pool-rbd" basename = "pool-rbd"
@ -1256,8 +1256,8 @@ class XMLParseTest(unittest.TestCase):
hostobj.name = "frobber" hostobj.name = "frobber"
hostobj.port = "5555" hostobj.port = "5555"
utils.diff_compare(pool.get_xml_config(), outfile) utils.diff_compare(pool.get_xml(), outfile)
utils.test_create(self.conn, pool.get_xml_config(), "storagePoolDefineXML") utils.test_create(self.conn, pool.get_xml(), "storagePoolDefineXML")
def testVol(self): def testVol(self):
basename = "pool-dir-vol" basename = "pool-dir-vol"
@ -1281,7 +1281,7 @@ class XMLParseTest(unittest.TestCase):
check("group", "10736", "10000") check("group", "10736", "10000")
check("label", None, "foo.label") check("label", None, "foo.label")
utils.diff_compare(vol.get_xml_config(), outfile) utils.diff_compare(vol.get_xml(), outfile)
################### ###################
@ -1353,8 +1353,8 @@ class XMLParseTest(unittest.TestCase):
check = self._make_checker(r) check = self._make_checker(r)
check("netmask", None, "foo", None) check("netmask", None, "foo", None)
utils.diff_compare(net.get_xml_config(), outfile) utils.diff_compare(net.get_xml(), outfile)
utils.test_create(self.conn, net.get_xml_config(), "networkDefineXML") utils.test_create(self.conn, net.get_xml(), "networkDefineXML")
def testNetOpen(self): def testNetOpen(self):
basename = "network-open" basename = "network-open"
@ -1379,8 +1379,8 @@ class XMLParseTest(unittest.TestCase):
check("start", "192.168.100.128", "192.168.101.128") check("start", "192.168.100.128", "192.168.101.128")
check("end", "192.168.100.254", "192.168.101.254") check("end", "192.168.100.254", "192.168.101.254")
utils.diff_compare(net.get_xml_config(), outfile) utils.diff_compare(net.get_xml(), outfile)
utils.test_create(self.conn, net.get_xml_config(), "networkDefineXML") utils.test_create(self.conn, net.get_xml(), "networkDefineXML")
def testNetVfPool(self): def testNetVfPool(self):
basename = "network-vf-pool" basename = "network-vf-pool"
@ -1405,8 +1405,8 @@ class XMLParseTest(unittest.TestCase):
check("slot", 0x10) check("slot", 0x10)
check("function", 0x0) check("function", 0x0)
utils.diff_compare(net.get_xml_config(), outfile) utils.diff_compare(net.get_xml(), outfile)
utils.test_create(self.conn, net.get_xml_config(), "networkDefineXML") utils.test_create(self.conn, net.get_xml(), "networkDefineXML")
############## ##############
@ -1422,7 +1422,7 @@ class XMLParseTest(unittest.TestCase):
guest.cpu.copy_host_cpu() guest.cpu.copy_host_cpu()
guest.cpu.clear() guest.cpu.clear()
utils.diff_compare(guest.get_xml_config(), outfile) utils.diff_compare(guest.get_xml(), outfile)
def testDomainRoundtrip(self): def testDomainRoundtrip(self):
# Make sure our XML engine doesn't mangle non-libvirt XML bits # Make sure our XML engine doesn't mangle non-libvirt XML bits
@ -1430,4 +1430,4 @@ class XMLParseTest(unittest.TestCase):
outfile = "tests/xmlparse-xml/domain-roundtrip.xml" outfile = "tests/xmlparse-xml/domain-roundtrip.xml"
guest = virtinst.Guest(self.conn, parsexml=open(infile).read()) guest = virtinst.Guest(self.conn, parsexml=open(infile).read())
utils.diff_compare(guest.get_xml_config(), outfile) utils.diff_compare(guest.get_xml(), outfile)

View File

@ -235,14 +235,14 @@ def define_changes(conn, inactive_xmlobj, devs, action, confirm):
for dev in devs: for dev in devs:
setup_device(dev) setup_device(dev)
conn.defineXML(inactive_xmlobj.get_xml_config()) conn.defineXML(inactive_xmlobj.get_xml())
print_stdout(_("Domain '%s' defined successfully.") % inactive_xmlobj.name) print_stdout(_("Domain '%s' defined successfully.") % inactive_xmlobj.name)
return True return True
def update_changes(domain, devs, action, confirm): def update_changes(domain, devs, action, confirm):
for dev in devs: for dev in devs:
xml = dev.get_xml_config() xml = dev.get_xml()
if confirm: if confirm:
if action == "hotplug": if action == "hotplug":
@ -276,7 +276,7 @@ def update_changes(domain, devs, action, confirm):
def prepare_changes(xmlobj, options, parserclass): def prepare_changes(xmlobj, options, parserclass):
origxml = xmlobj.get_xml_config() origxml = xmlobj.get_xml()
if options.edit != -1: if options.edit != -1:
devs = action_edit(xmlobj, options, parserclass) devs = action_edit(xmlobj, options, parserclass)
@ -290,7 +290,7 @@ def prepare_changes(xmlobj, options, parserclass):
devs = action_remove_device(xmlobj, options, parserclass) devs = action_remove_device(xmlobj, options, parserclass)
action = "hotunplug" action = "hotunplug"
newxml = xmlobj.get_xml_config() newxml = xmlobj.get_xml()
diff = get_diff(origxml, newxml) diff = get_diff(origxml, newxml)
if options.print_diff: if options.print_diff:
@ -427,7 +427,7 @@ def main(conn=None):
devs = action_build_xml(conn, options, parserclass) devs = action_build_xml(conn, options, parserclass)
for dev in devs: for dev in devs:
# pylint: disable=no-member # pylint: disable=no-member
print_stdout(dev.get_xml_config()) print_stdout(dev.get_xml())
return 0 return 0
if options.update: if options.update:

View File

@ -1071,7 +1071,7 @@ class vmmAddHardware(vmmGObjectUI):
def _add_device(self): def _add_device(self):
xml = self._dev.get_xml_config() xml = self._dev.get_xml()
logging.debug("Adding device:\n%s", xml) logging.debug("Adding device:\n%s", xml)
if self._remove_usb_controller: if self._remove_usb_controller:
@ -1090,7 +1090,7 @@ class vmmAddHardware(vmmGObjectUI):
controller = getattr(self._dev, "vmm_controller", None) controller = getattr(self._dev, "vmm_controller", None)
if controller is not None: if controller is not None:
logging.debug("Adding controller:\n%s", logging.debug("Adding controller:\n%s",
controller.get_xml_config()) controller.get_xml())
# Hotplug device # Hotplug device
attach_err = False attach_err = False
try: try:
@ -1443,7 +1443,7 @@ class vmmAddHardware(vmmGObjectUI):
setattr(self._dev, param_name, val) setattr(self._dev, param_name, val)
# Dump XML for sanity checking # Dump XML for sanity checking
self._dev.get_xml_config() self._dev.get_xml()
def _validate_page_video(self): def _validate_page_video(self):
model = uiutil.get_list_selection(self.widget("video-model")) model = uiutil.get_list_selection(self.widget("video-model"))

View File

@ -1061,7 +1061,7 @@ class vmmConnection(vmmGObject):
self._backend.daemon_version()) self._backend.daemon_version())
logging.debug("conn version=%s", self._backend.conn_version()) logging.debug("conn version=%s", self._backend.conn_version())
logging.debug("%s capabilities:\n%s", logging.debug("%s capabilities:\n%s",
self.get_uri(), self.caps.get_xml_config()) self.get_uri(), self.caps.get_xml())
# Try to create the default storage pool # Try to create the default storage pool
# We want this before events setup to save some needless polling # We want this before events setup to save some needless polling

View File

@ -930,9 +930,9 @@ class vmmCreateInterface(vmmGObjectUI):
# elements that might cause netcf to choke on # elements that might cause netcf to choke on
# for a sub-interface # for a sub-interface
xml = vmmiface.get_xmlobj( xml = vmmiface.get_xmlobj(
inactive=True).get_xml_config() inactive=True).get_xml()
else: else:
xml = row[INTERFACE_ROW_KEY].get_xml_config() xml = row[INTERFACE_ROW_KEY].get_xml()
child = Interface(self.conn.get_backend(), parsexml=xml) child = Interface(self.conn.get_backend(), parsexml=xml)
iobj.add_interface(child) iobj.add_interface(child)
@ -979,7 +979,7 @@ class vmmCreateInterface(vmmGObjectUI):
for proto in proto_xml: for proto in proto_xml:
iobj.add_protocol(InterfaceProtocol( iobj.add_protocol(InterfaceProtocol(
self.conn.get_backend(), self.conn.get_backend(),
parsexml=proto.get_xml_config())) parsexml=proto.get_xml()))
if itype == Interface.INTERFACE_TYPE_BRIDGE: if itype == Interface.INTERFACE_TYPE_BRIDGE:
ret = self.validate_bridge(iobj) ret = self.validate_bridge(iobj)
@ -993,7 +993,7 @@ class vmmCreateInterface(vmmGObjectUI):
if not ret: if not ret:
return ret return ret
iobj.get_xml_config() iobj.get_xml()
iobj.validate() iobj.validate()
self.interface = iobj self.interface = iobj

View File

@ -50,7 +50,7 @@ class vmmCreateVolume(vmmGObjectUI):
def show(self, parent): def show(self, parent):
try: try:
parent_xml = self.parent_pool.xmlobj.get_xml_config() parent_xml = self.parent_pool.xmlobj.get_xml()
except Exception: except Exception:
logging.debug("Error getting parent_pool xml", exc_info=True) logging.debug("Error getting parent_pool xml", exc_info=True)
parent_xml = None parent_xml = None

View File

@ -1011,7 +1011,7 @@ class vmmDomain(vmmLibvirtObject):
if not self.is_active(): if not self.is_active():
return return
devxml = devobj.get_xml_config() devxml = devobj.get_xml()
logging.debug("attach_device with xml=\n%s", devxml) logging.debug("attach_device with xml=\n%s", devxml)
self._backend.attachDevice(devxml) self._backend.attachDevice(devxml)
@ -1022,7 +1022,7 @@ class vmmDomain(vmmLibvirtObject):
if not self.is_active(): if not self.is_active():
return return
devxml = devobj.get_xml_config() devxml = devobj.get_xml()
logging.debug("detach_device with xml=\n%s", devxml) logging.debug("detach_device with xml=\n%s", devxml)
self._backend.detachDevice(devxml) self._backend.detachDevice(devxml)
@ -1030,7 +1030,7 @@ class vmmDomain(vmmLibvirtObject):
if flags is None: if flags is None:
flags = getattr(libvirt, "VIR_DOMAIN_DEVICE_MODIFY_LIVE", 1) flags = getattr(libvirt, "VIR_DOMAIN_DEVICE_MODIFY_LIVE", 1)
xml = devobj.get_xml_config() xml = devobj.get_xml()
logging.debug("update_device with xml=\n%s", xml) logging.debug("update_device with xml=\n%s", xml)
self._backend.updateDeviceFlags(xml, flags) self._backend.updateDeviceFlags(xml, flags)
@ -1965,7 +1965,7 @@ class vmmDomainVirtinst(vmmDomain):
def _XMLDesc(self, flags): def _XMLDesc(self, flags):
ignore = flags ignore = flags
return self._backend.get_xml_config() return self._backend.get_xml()
def _define(self, xml): def _define(self, xml):
ignore = xml ignore = xml
@ -1977,7 +1977,7 @@ class vmmDomainVirtinst(vmmDomain):
def _make_xmlobj_to_define(self): def _make_xmlobj_to_define(self):
if not self._orig_xml: if not self._orig_xml:
self._orig_xml = self._backend.get_xml_config() self._orig_xml = self._backend.get_xml()
return self._backend return self._backend
def _redefine_xmlobj(self, xmlobj, origxml=None): def _redefine_xmlobj(self, xmlobj, origxml=None):

View File

@ -112,9 +112,9 @@ class vmmLibvirtObject(vmmGObject):
logging.debug("Changing %s name from %s to %s", logging.debug("Changing %s name from %s to %s",
self, oldname, newname) self, oldname, newname)
origxml = xmlobj.get_xml_config() origxml = xmlobj.get_xml()
xmlobj.name = newname xmlobj.name = newname
newxml = xmlobj.get_xml_config() newxml = xmlobj.get_xml()
try: try:
self._key = newname self._key = newname
@ -293,7 +293,7 @@ class vmmLibvirtObject(vmmGObject):
""" """
origxml = None origxml = None
if self._xmlobj: if self._xmlobj:
origxml = self._xmlobj.get_xml_config() origxml = self._xmlobj.get_xml()
self._invalidate_xml() self._invalidate_xml()
active_xml = self._XMLDesc(self._active_xml_flags) active_xml = self._XMLDesc(self._active_xml_flags)
@ -371,9 +371,9 @@ class vmmLibvirtObject(vmmGObject):
we detect the actual XML change and log it correctly. we detect the actual XML change and log it correctly.
""" """
if not origxml: if not origxml:
origxml = self._make_xmlobj_to_define().get_xml_config() origxml = self._make_xmlobj_to_define().get_xml()
newxml = xmlobj.get_xml_config() newxml = xmlobj.get_xml()
self.log_redefine_xml_diff(self, origxml, newxml) self.log_redefine_xml_diff(self, origxml, newxml)
if origxml != newxml: if origxml != newxml:

View File

@ -466,7 +466,7 @@ class vmmSnapshotPage(vmmGObjectUI):
newsnap.name = name newsnap.name = name
newsnap.description = desc or None newsnap.description = desc or None
newsnap.validate() newsnap.validate()
newsnap.get_xml_config() newsnap.get_xml()
return newsnap return newsnap
except Exception as e: except Exception as e:
return self.err.val_err(_("Error validating snapshot: %s") % e) return self.err.val_err(_("Error validating snapshot: %s") % e)
@ -513,7 +513,7 @@ class vmmSnapshotPage(vmmGObjectUI):
if not snap: if not snap:
return return
xml = snap.get_xml_config() xml = snap.get_xml()
name = snap.name name = snap.name
mime, sndata = self._get_screenshot_data_for_save() mime, sndata = self._get_screenshot_data_for_save()
self._snapshot_new_close() self._snapshot_new_close()
@ -537,9 +537,9 @@ class vmmSnapshotPage(vmmGObjectUI):
desc = desc_widget.get_buffer().get_property("text") or "" desc = desc_widget.get_buffer().get_property("text") or ""
xmlobj = snap.get_xmlobj() xmlobj = snap.get_xmlobj()
origxml = xmlobj.get_xml_config() origxml = xmlobj.get_xml()
xmlobj.description = desc xmlobj.description = desc
newxml = xmlobj.get_xml_config() newxml = xmlobj.get_xml()
self.vm.log_redefine_xml_diff(snap, origxml, newxml) self.vm.log_redefine_xml_diff(snap, origxml, newxml)
if newxml == origxml: if newxml == origxml:

View File

@ -121,7 +121,7 @@ class vmmStorageBrowser(vmmGObjectUI):
def _volume_chosen(self, src, volume): def _volume_chosen(self, src, volume):
ignore = src ignore = src
logging.debug("Chosen volume XML:\n%s", volume.xmlobj.get_xml_config()) logging.debug("Chosen volume XML:\n%s", volume.xmlobj.get_xml())
self._finish(volume.get_target_path()) self._finish(volume.get_target_path())
def _vol_sensitive_cb(self, fmt): def _vol_sensitive_cb(self, fmt):

View File

@ -436,7 +436,7 @@ class Cloner(object):
self._prepare_nvram() self._prepare_nvram()
# Save altered clone xml # Save altered clone xml
self._clone_xml = self._guest.get_xml_config() self._clone_xml = self._guest.get_xml()
logging.debug("Clone guest xml is\n%s", self._clone_xml) logging.debug("Clone guest xml is\n%s", self._clone_xml)
def start_duplicate(self, meter=None): def start_duplicate(self, meter=None):

View File

@ -325,7 +325,7 @@ class Guest(XMLBuilder):
self.on_reboot = "destroy" self.on_reboot = "destroy"
self._set_osxml_defaults() self._set_osxml_defaults()
return self.get_xml_config() return self.get_xml()
########################### ###########################
@ -867,7 +867,7 @@ class Guest(XMLBuilder):
if not self.conn.is_test() and not self.conn.is_qemu(): if not self.conn.is_test() and not self.conn.is_qemu():
return return
if (self.cpu.get_xml_config().strip() or if (self.cpu.get_xml().strip() or
self.cpu.special_mode_was_set): self.cpu.special_mode_was_set):
# User already configured CPU # User already configured CPU
return return

View File

@ -238,7 +238,7 @@ class Interface(XMLBuilder):
Install network interface xml. Install network interface xml.
""" """
ignore = meter ignore = meter
xml = self.get_xml_config() xml = self.get_xml()
logging.debug("Creating interface '%s' with xml:\n%s", logging.debug("Creating interface '%s' with xml:\n%s",
self.name, xml) self.name, xml)

View File

@ -234,7 +234,7 @@ class Network(XMLBuilder):
################## ##################
def install(self, start=True, autostart=True): def install(self, start=True, autostart=True):
xml = self.get_xml_config() xml = self.get_xml()
logging.debug("Creating virtual network '%s' with xml:\n%s", logging.debug("Creating virtual network '%s' with xml:\n%s",
self.name, xml) self.name, xml)

View File

@ -163,7 +163,7 @@ class StoragePool(_StorageObject):
ret = [] ret = []
sources = _EnumerateSources(conn, xml) sources = _EnumerateSources(conn, xml)
for source in sources.sources: for source in sources.sources:
source_xml = source.get_xml_config() source_xml = source.get_xml()
pool_xml = "<pool>\n%s\n</pool>" % ( pool_xml = "<pool>\n%s\n</pool>" % (
util.xml_indent(source_xml, 2)) util.xml_indent(source_xml, 2))
@ -495,7 +495,7 @@ class StoragePool(_StorageObject):
raise ValueError(_("Must explicitly specify disk format if " raise ValueError(_("Must explicitly specify disk format if "
"formatting disk device.")) "formatting disk device."))
xml = self.get_xml_config() xml = self.get_xml()
logging.debug("Creating storage pool '%s' with xml:\n%s", logging.debug("Creating storage pool '%s' with xml:\n%s",
self.name, xml) self.name, xml)
@ -713,7 +713,7 @@ class StorageVolume(_StorageObject):
volxml = StorageVolume(self.conn, vol.XMLDesc(0)) volxml = StorageVolume(self.conn, vol.XMLDesc(0))
volxml.pool = pool volxml.pool = pool
logging.debug("Found backing store volume XML:\n%s", logging.debug("Found backing store volume XML:\n%s",
volxml.get_xml_config()) volxml.get_xml())
if volxml.supports_property("format"): if volxml.supports_property("format"):
logging.debug("Returning format=%s", volxml.format) logging.debug("Returning format=%s", volxml.format)
@ -775,7 +775,7 @@ class StorageVolume(_StorageObject):
if self.backing_store and not self.backing_format: if self.backing_store and not self.backing_format:
self.backing_format = self._detect_backing_store_format() self.backing_format = self._detect_backing_store_format()
xml = self.get_xml_config() xml = self.get_xml()
logging.debug("Creating storage volume '%s' with xml:\n%s", logging.debug("Creating storage volume '%s' with xml:\n%s",
self.name, xml) self.name, xml)

View File

@ -302,7 +302,7 @@ class XMLProperty(_XMLPropertyBase):
only if a default is registered, and only if the property was only if a default is registered, and only if the property was
not already explicitly set by the API user. not already explicitly set by the API user.
This is called during the get_xml_config process and shouldn't This is called during the get_xml process and shouldn't
be called from outside this file. be called from outside this file.
""" """
candefault, val = self._default_get_value(xmlbuilder) candefault, val = self._default_get_value(xmlbuilder)
@ -376,7 +376,7 @@ class XMLProperty(_XMLPropertyBase):
""" """
Set the value at user request. This just stores the value Set the value at user request. This just stores the value
in propstore. Setting the actual XML is only done at in propstore. Setting the actual XML is only done at
get_xml_config time. get_xml time.
""" """
if _trackprops and not self._is_tracked: if _trackprops and not self._is_tracked:
_seenprops.append(self) _seenprops.append(self)
@ -572,7 +572,7 @@ class XMLBuilder(object):
# Public XML managing APIs # # Public XML managing APIs #
############################ ############################
def get_xml_config(self): def get_xml(self):
""" """
Return XML string of the object Return XML string of the object
""" """
@ -718,7 +718,7 @@ class XMLBuilder(object):
object needs to have an associated mapping via XMLChildProperty object needs to have an associated mapping via XMLChildProperty
""" """
xmlprop = self._find_child_prop(obj.__class__) xmlprop = self._find_child_prop(obj.__class__)
xml = obj.get_xml_config() xml = obj.get_xml()
xmlprop.append(self, obj) xmlprop.append(self, obj)
self._set_child_xpaths() self._set_child_xpaths()
@ -738,7 +738,7 @@ class XMLBuilder(object):
xmlprop.remove(self, obj) xmlprop.remove(self, obj)
xpath = obj._xmlstate.abs_xpath() xpath = obj._xmlstate.abs_xpath()
xml = obj.get_xml_config() xml = obj.get_xml()
obj._set_xpaths(None, None) obj._set_xpaths(None, None)
obj._parse_with_children(xml, None) obj._parse_with_children(xml, None)
self._xmlstate.xmlapi.node_force_remove(xpath) self._xmlstate.xmlapi.node_force_remove(xpath)