[KVM-AUTOTEST PATCH 1/4] KVM test: kvm_config.py: parse extra strings passed as command line args

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

 



This allows to quickly see the effect of some extra code, e.g.

./kvm_config.py tests.cfg "only my_set" "no qcow2"

The given strings may contain newlines.

Signed-off-by: Michael Goldish <mgoldish@xxxxxxxxxx>
---
 client/tests/kvm/kvm_config.py |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/client/tests/kvm/kvm_config.py b/client/tests/kvm/kvm_config.py
index 807a204..cab0022 100755
--- a/client/tests/kvm/kvm_config.py
+++ b/client/tests/kvm/kvm_config.py
@@ -640,7 +640,9 @@ class FileReader(StrReader):
 
 
 if __name__ == "__main__":
-    parser = optparse.OptionParser("usage: %prog [options] <filename>")
+    parser = optparse.OptionParser('usage: %prog [options] filename '
+                                   '[extra code] ...\n\nExample:\n\n    '
+                                   '%prog tests.cfg "only my_set" "no qcow2"')
     parser.add_option("-v", "--verbose", dest="debug", action="store_true",
                       help="include debug messages in console output")
     parser.add_option("-f", "--fullname", dest="fullname", action="store_true",
@@ -653,6 +655,9 @@ if __name__ == "__main__":
         parser.error("filename required")
 
     c = Parser(args[0], debug=options.debug)
+    for s in args[1:]:
+        c.parse_string(s)
+
     for i, d in enumerate(c.get_dicts()):
         if options.fullname:
             print "dict %4d:  %s" % (i + 1, d["name"])
-- 
1.7.3.4

--
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