qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 3/4] qapi-types.py: Fail gracefully if out dir i


From: Michael Roth
Subject: Re: [Qemu-devel] [PATCH 3/4] qapi-types.py: Fail gracefully if out dir is not specified
Date: Mon, 17 Oct 2011 16:27:34 -0500

On Mon, 17 Oct 2011 13:29:36 -0200, Luiz Capitulino <address@hidden> wrote:
> Otherwise we get:
> 
> Traceback (most recent call last):
>       File "./scripts/qapi-types.py", line 183, in <module>
>           os.makedirs(output_dir)
>         File "/usr/lib64/python2.7/os.py", line 157, in makedirs
>           mkdir(name, mode)
>       OSError: [Errno 2] No such file or directory: ''
> 
> Signed-off-by: Luiz Capitulino <address@hidden>
> ---
>  scripts/qapi-types.py |    6 +++++-
>  1 files changed, 5 insertions(+), 1 deletions(-)
> 
> diff --git a/scripts/qapi-types.py b/scripts/qapi-types.py
> index 8df4b72..4a2ddc4 100644
> --- a/scripts/qapi-types.py
> +++ b/scripts/qapi-types.py
> @@ -178,7 +178,11 @@ if __name__ == '__main__':
>              prefix = a
>          elif o in ("-o", "--output-dir"):
>              output_dir = a
> -    
> +
> +    if not output_dir:
> +        sys.stdout.write("ouput directory was not specified\n")
> +        sys.exit(1)
> +   

We should probably just set output_dir to os.getcwd() here.

>      c_file = os.path.join(output_dir, prefix + c_file)
>      h_file = os.path.join(output_dir, prefix + h_file)
>      
> -- 
> 1.7.7.rc3
> 

-- 
Sincerely,
Mike Roth
IBM Linux Technology Center



reply via email to

[Prev in Thread] Current Thread [Next in Thread]