CC-2272: Ability to change storage directory location
make sure imported and organize dirs are created
This commit is contained in:
parent
6b9066466b
commit
75e9ecf985
2 changed files with 6 additions and 4 deletions
|
@ -106,9 +106,7 @@ class AirtimeProcessEvent(ProcessEvent):
|
|||
|
||||
#checks if path is a directory, and if it doesnt exist, then creates it.
|
||||
#Otherwise prints error to log file.
|
||||
def ensure_is_dir(self, filepath):
|
||||
directory = os.path.dirname(filepath)
|
||||
|
||||
def ensure_is_dir(self, directory):
|
||||
try:
|
||||
omask = os.umask(0)
|
||||
if not os.path.exists(directory):
|
||||
|
@ -213,7 +211,7 @@ class AirtimeProcessEvent(ProcessEvent):
|
|||
|
||||
filepath = self.create_unique_filename(filepath, original_path)
|
||||
self.logger.info('Unique filepath: %s', filepath)
|
||||
self.ensure_is_dir(filepath)
|
||||
self.ensure_is_dir(os.path.dirname(filepath))
|
||||
|
||||
except Exception, e:
|
||||
self.logger.error('Exception: %s', e)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue