summaryrefslogtreecommitdiffstats
path: root/pykolab/setup/setup_mta.py
diff options
context:
space:
mode:
Diffstat (limited to 'pykolab/setup/setup_mta.py')
-rw-r--r--pykolab/setup/setup_mta.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/pykolab/setup/setup_mta.py b/pykolab/setup/setup_mta.py
index 9cd428b..8b33ef2 100644
--- a/pykolab/setup/setup_mta.py
+++ b/pykolab/setup/setup_mta.py
@@ -272,9 +272,12 @@ result_format = shared+%%s
current_value = myaugeas.get(setting)
if current_value == None:
- insert_paths = myaugeas.match('/files/etc/postfix/main.cf/*')
- insert_path = insert_paths[(len(insert_paths)-1)]
- myaugeas.insert(insert_path, setting_key, False)
+ try:
+ myaugeas.set(setting, postfix_main_settings[setting_key])
+ except:
+ insert_paths = myaugeas.match('/files/etc/postfix/main.cf/*')
+ insert_path = insert_paths[(len(insert_paths)-1)]
+ myaugeas.insert(insert_path, setting_key, False)
log.debug(_("Setting key %r to %r") % (setting_key, postfix_main_settings[setting_key]), level=8)
myaugeas.set(setting, postfix_main_settings[setting_key])