Just as we made with the kvm based class, reformat
the command that is going to be printed to the logs,
making it more readable. With the patch, a virt-install
command line now looks like:

18:52:54 INFO | Running libvirt command (reformatted):
18:52:54 INFO | /usr/bin/virt-install
18:52:54 INFO |     --hvm
18:52:54 INFO |     --accelerate
18:52:54 INFO |     --name 'vm1'
18:52:54 INFO |     --ram=1024
18:52:54 INFO |     --vcpu=2
18:52:54 INFO |     --location /tmp/libvirt_autotest_root/
18:52:54 INFO |     --vnc
18:52:54 INFO |     --os-type linux
18:52:54 INFO |     --serial file,path=/tmp/serial-20120823-184442-fDoeZO3Z
18:52:54 INFO |     --serial pty
18:52:54 INFO |     --disk 
path=/tmp/libvirt_autotest_root/images/f17-64.raw,bus=virtio,size=10,format=raw,cache=none
18:52:54 INFO |     --disk 
path=/tmp/libvirt_autotest_root/isos/linux/Fedora-17-x86_64-DVD.iso,device=cdrom
18:52:54 INFO |     --disk 
path=/tmp/libvirt_autotest_root/images/f17-64/ks.iso,device=cdrom
18:52:54 INFO |     --network=bridge=virbr0,model=virtio,mac=52:54:00:34:35:36
18:52:54 INFO |     --extra-args 'repo=cdrom:/dev/sr1 ks=cdrom:/dev/sr0 
nicdelay=60 console=ttyS0,115200 console=tty0'
18:52:54 INFO |     --noautoconsole

Signed-off-by: Lucas Meneghel Rodrigues <[email protected]>
---
 client/virt/libvirt_vm.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/client/virt/libvirt_vm.py b/client/virt/libvirt_vm.py
index 898169d..5b13043 100644
--- a/client/virt/libvirt_vm.py
+++ b/client/virt/libvirt_vm.py
@@ -1453,7 +1453,9 @@ class VM(virt_vm.BaseVM):
             # Make qemu command
             install_command = self.__make_libvirt_command()
 
-            logging.info("Running libvirt command:\n%s", install_command)
+            logging.info("Running libvirt command (reformatted):")
+            for item in install_command.replace(" -", " \n    -").splitlines():
+                logging.info("%s", item)
             utils.run(install_command, verbose=False)
             # Wait for the domain to be created
             utils_misc.wait_for(func=self.is_alive, timeout=60,
-- 
1.7.11.4

_______________________________________________
Autotest-kernel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/autotest-kernel

Reply via email to