CC-2589 : Create organize dir for updates

This commit is contained in:
Naomi Aro 2011-07-25 17:01:44 +02:00
parent 40fd2cf8d7
commit a57e5bd557
1 changed files with 8 additions and 1 deletions

View File

@ -25,8 +25,15 @@ config = ConfigParser.RawConfigParser()
config.read('/etc/airtime/airtime.conf')
stor_dir = config.get('general', 'base_files_dir') + "/stor"
if not os.path.exists(stor_dir + '/organize'):
try:
os.makedirs(stor_dir + '/organize')
omask = os.umask(0)
os.chmod(stor_dir + '/organize', 02777)
except Exception, e:
print e
finally:
os.umask(omask)
mmconfig.storage_directory = os.path.normpath(stor_dir)
mmconfig.imported_directory = os.path.normpath(stor_dir + '/imported')