On 01/18/2012 06:24 PM, Chris Evich wrote:
> Signed-off-by: Chris Evich<[email protected]>

Applied, thanks Chris!

> ---
>   client/bin/autotest   |    9 +++++++--
>   client/virt/kvm_vm.py |    8 ++++++--
>   2 files changed, 13 insertions(+), 4 deletions(-)
>
> diff --git a/client/bin/autotest b/client/bin/autotest
> index 6431250..69b4641 100755
> --- a/client/bin/autotest
> +++ b/client/bin/autotest
> @@ -25,8 +25,13 @@ os.environ['PYTHONPATH'] = autodirbin
>
>   cmd_parser = cmdparser.CommandParser() # Allow access to instance in parser
>
> -parser = OptionParser(usage='Usage: %prog [options] [command]<control-file>',
> -                      epilog="[command]\t\tOne of: "+str(cmd_parser.cmdlist))
> +commandinfo = "[command] (optional)\tOne of: "+str(cmd_parser.cmdlist)
> +if sys.version_info[0:2]<  (2,6):
> +    parser = OptionParser(usage='Usage: %prog [options] 
> [command]<control-file>',
> +                          description=commandinfo)
> +else:
> +    parser = OptionParser(usage='Usage: %prog [options] 
> [command]<control-file>',
> +                          epilog=commandinfo)
>
>   parser.add_option("-a", "--args", dest='args',
>                           help="additional args to pass to control file")
> diff --git a/client/virt/kvm_vm.py b/client/virt/kvm_vm.py
> index c0d10c2..240a779 100644
> --- a/client/virt/kvm_vm.py
> +++ b/client/virt/kvm_vm.py
> @@ -199,8 +199,12 @@ class VM(virt_vm.BaseVM):
>               """
>               Add option to qemu parameters.
>               """
> +            fmt=",%s=%s"
>               if value and isinstance(value, bool):
> -                return ",%s=%s" % (option, "on" if value else "off")
> +                if value:
> +                    return fmt % (option, "on")
> +                else:
> +                    return fmt % (option, "off")
>               elif value and isinstance(value, str):
>                   # "EMPTY_STRING" and "NULL_STRING" is used for testing 
> illegal
>                   # foramt of option.
> @@ -212,7 +216,7 @@ class VM(virt_vm.BaseVM):
>                       return ",%s" % option
>                   if value == "EMPTY_STRING":
>                       value = '""'
> -                return ",%s=%s" % (option, str(value))
> +                return fmt % (option, str(value))
>               return ""
>
>

_______________________________________________
Autotest mailing list
[email protected]
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest

Reply via email to