From: Philipp Hahn Date: Wed, 12 Oct 2011 14:54:40 +0000 (+0200) Subject: example: Fix argument handling X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=08d56e24b088be004e432a8d22d2ddea0556efa1;p=libvirt.git example: Fix argument handling sys.argv contains the original command line arguments, while args only contains the arguments not handled by getopt(). Currently this is no problem since --help is the only command line option passable, which terminates the process, so the code is never reached. Any option added in the future will reveal the bug. Signed-off-by: Philipp Hahn --- diff --git a/examples/domain-events/events-python/event-test.py b/examples/domain-events/events-python/event-test.py index 76fda2bb4d..9018366512 100644 --- a/examples/domain-events/events-python/event-test.py +++ b/examples/domain-events/events-python/event-test.py @@ -486,8 +486,8 @@ def main(): usage() sys.exit() - if len(sys.argv) > 1: - uri = sys.argv[1] + if len(args) >= 1: + uri = args[0] else: uri = "qemu:///system"