make sure we create tmp directory for media-monitor if it doesn't exist.

This commit is contained in:
Martin Konecny 2012-04-27 16:04:19 -04:00
parent f6ff289506
commit 0e32b5586f
1 changed files with 4 additions and 0 deletions

View File

@ -27,6 +27,10 @@ class AirtimeMediaMonitorBootstrap():
self.logger.info("Adding %s on watch list...", self.mount_file)
self.wm.add_watch(self.mount_file, pyinotify.ALL_EVENTS, rec=False, auto_add=False)
tmp_dir = os.path.dirname(self.curr_mtab_file)
if not os.path.exists(tmp_dir):
os.makedirs(tmp_dir)
# create currMtab file if it's the first time
if not os.path.exists(self.curr_mtab_file):
shutil.copy('/etc/mtab', self.curr_mtab_file)