Received: from eggs.gnu.org ([140.186.70.92]:48822) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RFuin-0006dr-Ry for qemu-devel@nongnu.org; Mon, 17 Oct 2011 17:27:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RFuim-0007sT-GD for qemu-devel@nongnu.org; Mon, 17 Oct 2011 17:27:45 -0400 Received: from mout.perfora.net ([74.208.4.194]:49999) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RFuim-0007sG-3v for qemu-devel@nongnu.org; Mon, 17 Oct 2011 17:27:44 -0400 From: Michael Roth In-Reply-To: <1318865377-3328-4-git-send-email-lcapitulino@redhat.com> References: <1318865377-3328-1-git-send-email-lcapitulino@redhat.com> <1318865377-3328-4-git-send-email-lcapitulino@redhat.com> Date: Mon, 17 Oct 2011 16:27:34 -0500 Message-Id: <0M4G3X-1Qz4UO2nGl-00rP32@mrelay.perfora.net> Subject: Re: [Qemu-devel] [PATCH 3/4] qapi-types.py: Fail gracefully if out dir is not specified List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Luiz Capitulino Cc: aliguori@us.ibm.com, qemu-devel@nongnu.org On Mon, 17 Oct 2011 13:29:36 -0200, Luiz Capitulino wrote: > Otherwise we get: > > Traceback (most recent call last): > File "./scripts/qapi-types.py", line 183, in > 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 > --- > 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