edf-hpc / clara

Cluster Administration tools
Other
18 stars 12 forks source link

Missing directory #95

Closed antonjrusso closed 7 years ago

antonjrusso commented 7 years ago

In an installation from scratch, clara failed with some errors: File "build/bdist.linux-x86_64/egg/clara/utils.py", line 151, in initialize_logger File "/usr/lib64/python2.7/logging/__init__.py", line 902, in __init__ StreamHandler.__init__(self, self._open()) File "/usr/lib64/python2.7/logging/__init__.py", line 925, in _open stream = open(self.baseFilename, self.mode) IOError: [Errno 2] No such file or directory: '/var/log/clara/all.log'

I've fixed this issue with the following patch: --- a/clara/utils.py +++ b/clara/utils.py @@ -136,6 +136,10 @@ def initialize_logger(debug): logger = logging.getLogger() logger.setLevel(logging.DEBUG) + # Create logs directory if not exist + if not os.path.exists(output_dir): + os.makedirs(output_dir) + # Create console handler and set level to info or debug, when it's enabled handler = logging.StreamHandler() if debug:

ana commented 7 years ago

FYI: this directory is created by the Debian packaging.