Use one write with heredocs and move to the with statement as per PEP343
Switch over to using lxml instead of libxml2

Signed-off-by: Chris Lalancette <clalancette@gmail.com>
Validate the TDL schema.

Signed-off-by: Chris Lalancette <clalancette@gmail.com>
Appease MacOSX for tests.
Fix up unit tests.

Signed-off-by: Chris Lalancette <clalancette@gmail.com>
StringIO is in the io module in Python 3
Remove dead code paths in `_parse_disksize()`
Fix a small bug in icicle generation from lxml conversion.

Signed-off-by: Chris Lalancette <clalancette@gmail.com>
Make sure to sleep while doing ssh connection test.

If an ssh connection test failed very quickly, we could
burn through all of our tries before sshd in the guest
could ever had a chance to start.  Instead, make sure we
do a sleep in the loop if the ssh command very fast.
Also add some extra debug statements so it is easier to
debug this issue.

Signed-off-by: Chris Lalancette <clalancette@gmail.com>
Fix an OpenSUSE bug introduced by lxml conversion.

Signed-off-by: Chris Lalancette <clalancette@gmail.com>
Fix ssh timeouts on Ubuntu and OpenSuse as well.

Signed-off-by: Chris Lalancette <clalancette@gmail.com>
Fix up more fallout from "with" conversion.

Signed-off-by: Chris Lalancette <clalancette@gmail.com>
Remove 2 FIXME comments that no longer apply.

Signed-off-by: Chris Lalancette <clalancette@gmail.com>
Don't use default arguments of lists or dictionaries.

This probably doesn't matter in practice for us, but is
good practice nonetheless.  Default arguments as lists or
dictionaries are dangerous in python, since they can be
modified by the called function, and will retain that
value.  Just use None as the default value instead.

Signed-off-by: Chris Lalancette <clalancette@gmail.com>
Fix more fallout from lxml conversion.

Signed-off-by: Chris Lalancette <clalancette@gmail.com>
Make a LinuxCDClass

Signed-off-by: Chris Lalancette <clalancette@gmail.com>
Remove tunnels.

Signed-off-by: Chris Lalancette <clalancette@gmail.com>
Add tests for various scenarios in libvirt and tdl xml handling