diff options
Diffstat (limited to 'src')
-rwxr-xr-x | src/msec/libmsec.py | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/src/msec/libmsec.py b/src/msec/libmsec.py index 89af772..46c511d 100755 --- a/src/msec/libmsec.py +++ b/src/msec/libmsec.py @@ -430,15 +430,6 @@ class ConfigFile: except: error('unlink %s: %s' % (self.path, str(sys.exc_value))) self.log.info(_('deleted %s') % (self.path,)) - elif self.is_modified: - content = string.join(self.lines, "\n") - dirname = os.path.dirname(self.path) - if not os.path.exists(dirname): - os.makedirs(dirname) - file = open(self.path, 'w') - file.write(content) - file.close() - self.meta.modified(self.path) elif self.is_touched: if os.path.exists(self.path): try: @@ -477,11 +468,19 @@ class ConfigFile: except: self.log.error('symlink %s %s: %s' % (self.sym_link, self.path, str(sys.exc_value))) self.log.info(_('made symbolic link from %s to %s') % (self.sym_link, self.path)) - - if self.is_moved: + elif self.is_moved: move(self.path, self.path + self.suffix) self.log.info(_('moved file %s to %s') % (self.path, self.path + self.suffix)) self.meta.modified(self.path) + elif self.is_modified: + content = string.join(self.lines, "\n") + dirname = os.path.dirname(self.path) + if not os.path.exists(dirname): + os.makedirs(dirname) + file = open(self.path, 'w') + file.write(content) + file.close() + self.meta.modified(self.path) self.is_touched = 0 self.is_modified = 0 self.is_deleted = 0 |