[et-mgmt-tools] [PATCH] virt-convert: fix option handling

John Levon levon at movementarian.org
Wed Jul 2 04:50:30 UTC 2008


Fix up options handling for input dirs.

If we specify an input directory, and no output, then default to placing
a config file in the input directory.

Signed-off-by: John Levon <john.levon at sun.com>

diff --git a/virt-convert b/virt-convert
--- a/virt-convert
+++ b/virt-convert
@@ -80,6 +80,8 @@ def parse_args():
     if len(args) == 1:
         options.output_file = None
         options.output_dir = None
+        if os.path.isdir(args[0]):
+            options.output_dir = options.input_dir
     elif os.path.isdir(args[1]) or args[1].endswith("/"):
         options.output_file = None
         options.output_dir = args[1]




More information about the et-mgmt-tools mailing list