CC-1799 Put Airtime Storage into a Human Readable File Naming Convention

change for proper file permissions on directories created.
This commit is contained in:
Naomi Aro 2011-06-09 15:17:17 +02:00
parent 9da314979e
commit 2900ef4bb1
1 changed files with 8 additions and 2 deletions

View File

@ -164,8 +164,13 @@ class MediaMonitor(ProcessEvent):
directory = os.path.dirname(filepath) directory = os.path.dirname(filepath)
try:
omask = os.umask(0)
if ((not os.path.exists(directory)) or ((os.path.exists(directory) and not os.path.isdir(directory)))): if ((not os.path.exists(directory)) or ((os.path.exists(directory) and not os.path.isdir(directory)))):
os.makedirs(directory, 02775) os.makedirs(directory, 02775)
finally:
os.umask(omask)
def create_unique_filename(self, filepath): def create_unique_filename(self, filepath):
@ -293,6 +298,7 @@ class MediaMonitor(ProcessEvent):
if(response['airtime_status'] == 0): if(response['airtime_status'] == 0):
filepath = self.create_file_path(event.pathname) filepath = self.create_file_path(event.pathname)
shutil.move(event.pathname, filepath) shutil.move(event.pathname, filepath)
#must change
self.update_airtime(filepath) self.update_airtime(filepath)
self.logger.info("%s: %s", event.maskname, event.pathname) self.logger.info("%s: %s", event.maskname, event.pathname)