On 08/01/2012 05:21 AM, Yu Mingfei wrote:
Hi Chris,Lucas:
Thanks your comments of v1 patchset.
In fact, I mistaked the value "vm_xml.name".^_^
But I have read xml_utils.py and ElementTree.py carefully.
I'm sure you did, the problem is ElementTree isn't written very clearly :(
I find that only class _ElementInterface has function remove(...),
It's confusing (and I'm not sure why they did) it but you'll see later:
ElementTree = _ElementInterface
but I can not get it from ElementTree, so as class XMLBase.
You can get an Element instance from ElementTree using many of it's
methods, including get_root() and find(). Be sure to checkout the new
xml_utils in next branch, I renamed XMLBase -> XMLTreeFile since I see
it will be used as more than just a base class.
Since XMLBase inherit ElementTree, I move remove() to class XMLBase.
Is this ok?
Since using Element.remove() is a bit convoluted, adding remove() method
to XMLBase (now XMLTreeFile) is perfectly acceptable.
In addition, I still use libvirt_vm.py as virsh because the work of
moving virsh_xxx()
is underway.
Yes, this is fine. After having done it the easy way, I see what a mess
it will cause. We'll sort this part out later.
Yu Mingfei (2):
shared.xml_utils:add remove function to XMLBase.
virt.libvirt_xml:operations of libvirt xmlfile.
client.tests.libvirt:a testcase to rename a domain(just to help your
test).
client/shared/xml_utils.py | 10 +++++
client/tests/libvirt/tests/virsh_rename_domain.py | 25 ++++++++++++
client/virt/libvirt_xml.py | 42 +++++++++++++++++++++
client/virt/subtests.cfg.sample | 5 ++
4 files changed, 82 insertions(+), 0 deletions(-)
create mode 100644 client/tests/libvirt/tests/virsh_rename_domain.py
create mode 100644 client/virt/libvirt_xml.py
--
Chris Evich, RHCA, RHCE, RHCDS, RHCSS
Quality Assurance Engineer
e-mail: cevich + `@' + redhat.com o: 1-888-RED-HAT1 x44214
_______________________________________________
Autotest-kernel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/autotest-kernel