Commit 7ef7bf17 authored by Arnaud Fontaine's avatar Arnaud Fontaine

Try creating the report directory if it does not already exist.

parent 6ab5a6b2
...@@ -32,9 +32,10 @@ import argparse ...@@ -32,9 +32,10 @@ import argparse
class ArgumentType(object): class ArgumentType(object):
@classmethod @classmethod
def directoryType(cls, path): def directoryType(cls, path):
if not (os.path.isdir(path) and os.access(path, os.W_OK)): if not os.path.exists(path):
raise argparse.ArgumentTypeError("'%s' is not a valid directory or is "\ os.makedirs(path)
"not writable" % path) elif not (os.path.isdir(path) and os.access(path, os.W_OK)):
raise argparse.ArgumentTypeError("'%s' does not seem to be writable" % path)
return path return path
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment