Commit 67a51c1e authored by Sriram Karra's avatar Sriram Karra

Merge pull request #86 from DamienCassou/state.json_creation_permission

Ensure state.json has user write bit permission
parents cede7217 bb60a03f
......@@ -27,7 +27,7 @@
## and we are continuing to use the same handling framework...
import iso8601, demjson
import glob, logging, os, re, shutil, sys, time
import glob, logging, os, re, shutil, sys, time, stat
sync_dirs = ['SYNC1WAY', 'SYNC2WAY']
......@@ -152,10 +152,15 @@ class Config:
print user_dir
print 'We have not copied any of your logs and backup directories.'
else:
dest_state = os.path.join(user_dir, 'state.json')
## Looks like this is a pretty "clean" run. So just copy the
## state.init file to get things rolling
shutil.copy2(os.path.join(base_dir, 'state.init.json'),
os.path.join(user_dir, 'state.json'))
dest_state)
## Add user write permission in case state.init.json
## was not writable
os.chmod(dest_state,
os.stat(dest_state).st_mode | stat.S_IWUSR)
def _migrate_config_if_reqd (self, curr_ver):
user_dir = self.get_user_dir()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment