From 1066fdb4eba76e16d2b9db523a3ea9b167872b6e Mon Sep 17 00:00:00 2001 From: souliane Date: Mon, 24 Mar 2014 16:43:08 +0100 Subject: [PATCH] memory: bug fix the current local_dir after sat.conf is auto-updated --- src/memory/memory.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/memory/memory.py b/src/memory/memory.py index 848d44fb..58e1a3f3 100644 --- a/src/memory/memory.py +++ b/src/memory/memory.py @@ -163,10 +163,12 @@ class Memory(object): target_file = BaseDirectory.save_config_path('sat') + '/sat.conf' config.set('', 'local_dir', old_default) with open(target_file, 'wb') as configfile: - config.write(configfile) + config.write(configfile) # for the next time that user launches sat warning(_("Auto-update: local_dir set to %(path)s in the file %(config_file)s") % {'path': old_default, 'config_file': file_}) + default = old_default else: # use the new default local_dir - self.config.set('', 'local_dir', C.DEFAULT_LOCAL_DIR) + default = C.DEFAULT_LOCAL_DIR + self.config.set('', 'local_dir', default) # for the currently running instance def getConfig(self, section, name): """Get the main configuration option