[PATCH] KVM test: get_started.py: Create from all sample files found

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Rather than keeping a list of sample files on the kvm test
dir, just glob for them and create the actual config files
as needed. This way we won't have to modify the program
every time a new config file gets added.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@xxxxxxxxxx>
---
 client/tests/kvm/get_started.py |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/client/tests/kvm/get_started.py b/client/tests/kvm/get_started.py
index d97fd8a..1a65613 100755
--- a/client/tests/kvm/get_started.py
+++ b/client/tests/kvm/get_started.py
@@ -5,7 +5,7 @@ Program to help setup kvm test environment
 @copyright: Red Hat 2010
 """
 
-import os, sys, logging, shutil
+import os, sys, logging, shutil, glob
 import common
 from autotest_lib.client.common_lib import logging_manager
 from autotest_lib.client.bin import utils
@@ -85,11 +85,10 @@ if __name__ == "__main__":
                  "config samples to actual config files)")
     kvm_test_dir = os.path.dirname(sys.modules[__name__].__file__)
     kvm_test_dir = os.path.abspath(kvm_test_dir)
-    config_file_list = ["build.cfg", "cdkeys.cfg", "tests_base.cfg",
-                        "tests.cfg", "unittests.cfg", "virtio-win.cfg"]
+    config_file_list = glob.glob(os.path.join(kvm_test_dir, "*.cfg.sample"))
     for config_file in config_file_list:
-        src_file = os.path.join(kvm_test_dir, "%s.sample" % config_file)
-        dst_file = os.path.join(kvm_test_dir, config_file)
+        src_file = config_file
+        dst_file = src_file.rstrip(".sample")
         if not os.path.isfile(dst_file):
             logging.debug("Creating config file %s from sample", dst_file)
             shutil.copyfile(src_file, dst_file)
-- 
1.7.6

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux