public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Lucas Meneghel Rodrigues <lmr@redhat.com>
To: autotest@test.kernel.org
Cc: kvm@vger.kernel.org
Subject: [PATCH 12/16] Virt: small fixes related to libvirt unattended install when using auto url
Date: Thu,  3 Nov 2011 19:26:18 -0200	[thread overview]
Message-ID: <1320355582-4342-13-git-send-email-lmr@redhat.com> (raw)
In-Reply-To: <1320355582-4342-1-git-send-email-lmr@redhat.com>

This patch adds a simple formatting chance (to stay withing the 79 cols),
and two small fixes to parameter parsing when using auto url feature.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
---
 client/virt/libvirt_vm.py               |    9 ++++++---
 client/virt/tests/unattended_install.py |    8 +++++---
 2 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/client/virt/libvirt_vm.py b/client/virt/libvirt_vm.py
index f29cdc4..129c214 100644
--- a/client/virt/libvirt_vm.py
+++ b/client/virt/libvirt_vm.py
@@ -533,9 +533,10 @@ class VM(virt_vm.BaseVM):
         # Clone this VM using the new params
         vm = self.clone(name, params, root_dir, copy_state=True)
 
-        virt_install_binary = virt_utils.get_path(root_dir,
-                                    params.get("virt_install_binary",
-                                    "virt-install"))
+        virt_install_binary = virt_utils.get_path(
+            root_dir,
+            params.get("virt_install_binary",
+                       "virt-install"))
 
         help = utils.system_output("%s --help" % virt_install_binary)
 
@@ -573,6 +574,8 @@ class VM(virt_vm.BaseVM):
         if params.get("medium") == 'url':
             if params.get("url") == 'auto':
                 location = params.get('auto_content_url')
+            else:
+                location = params.get('url')
 
         elif params.get("medium") == 'kernel_initrd':
             # directory location of kernel/initrd pair (directory layout must
diff --git a/client/virt/tests/unattended_install.py b/client/virt/tests/unattended_install.py
index daeb453..862ea80 100644
--- a/client/virt/tests/unattended_install.py
+++ b/client/virt/tests/unattended_install.py
@@ -528,12 +528,14 @@ class UnattendedInstallConfig(object):
         ks_param = 'ks=http://%s:%s/%s' % (self.url_auto_content_ip,
                                            self.unattended_server_port,
                                            dest_fname)
-        if 'ks=' in getattr(self, 'extra_params'):
+        self.extra_params = getattr(self, 'extra_params')
+        if 'ks=' in self.extra_params:
             extra_params = re.sub('ks\=[\w\d\:\.\/]+',
                                   ks_param,
-                                  getattr(self, 'extra_params'))
+                                  self.extra_params)
         else:
-            extra_params += ' %s ' % ks_param
+            extra_params = '%s %s' % (self.extra_params,
+                                      ks_param)
 
         # reflect change on params
         self.extra_params = extra_params
-- 
1.7.7

  parent reply	other threads:[~2011-11-03 21:26 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-03 21:26 [PATCH 00/16] Libvirt test v5 Lucas Meneghel Rodrigues
2011-11-03 21:26 ` [PATCH 02/16] virt: Introducing virt_test.virt_test class Lucas Meneghel Rodrigues
2011-11-03 21:26 ` [PATCH 03/16] Moving unattended_install test from kvm test to common virt location Lucas Meneghel Rodrigues
2011-11-03 21:26 ` [PATCH 04/16] Moving get_started code to client.virt.virt_utils Lucas Meneghel Rodrigues
2011-11-03 21:26 ` [PATCH 05/16] virt: Introducing libvirt VM class Lucas Meneghel Rodrigues
2011-11-03 21:26 ` [PATCH 06/16] virt: Introducing libvirt monitor Lucas Meneghel Rodrigues
2011-11-03 21:26 ` [PATCH 07/16] virt.virt_env_process: Add libvirt vm handling Lucas Meneghel Rodrigues
2011-11-03 21:26 ` [PATCH 08/16] client.tests: Introducing libvirt test Lucas Meneghel Rodrigues
2011-11-03 21:26 ` [PATCH 09/16] Virt: builtin HTTP server for unattended installs Lucas Meneghel Rodrigues
2011-11-03 21:26 ` [PATCH 10/16] Virt: support XEN via libvirt and auto url installer Lucas Meneghel Rodrigues
2011-11-03 21:26 ` [PATCH 11/16] Virt: add support for XEN via libvirt installs and auto url Lucas Meneghel Rodrigues
2011-11-03 21:26 ` Lucas Meneghel Rodrigues [this message]
2011-11-03 21:26 ` [PATCH 13/16] Virt: pass verbatim hvm_or_pv option to virt_install Lucas Meneghel Rodrigues
2011-11-03 21:26 ` [PATCH 14/16] Virt: add sample configuration for XEN HVM domains Lucas Meneghel Rodrigues
2011-11-03 21:26 ` [PATCH 15/16] virt: Fix unattended install for libvirt case Lucas Meneghel Rodrigues
2011-11-03 21:26 ` [PATCH 16/16] Virt: adjust auto http servers (content/kickstart) ports to not overlap Lucas Meneghel Rodrigues
2011-11-04  3:57 ` [PATCH 00/16] Libvirt test v5 Lucas Meneghel Rodrigues

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1320355582-4342-13-git-send-email-lmr@redhat.com \
    --to=lmr@redhat.com \
    --cc=autotest@test.kernel.org \
    --cc=kvm@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox