summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorhagbard <vyosdev@derith.de>2019-11-28 10:08:11 -0800
committerhagbard <vyosdev@derith.de>2019-11-28 10:08:11 -0800
commit26677aa3ce312a5b980ea88d57feebd09e39fd98 (patch)
tree500accb618a293d1974e70bf2734e5867a5b167d /python
parent525af4f27dc2aa7e226f2bba46b4b1736bbc014f (diff)
parentdad110ce666edae42ac18c59a800bda503589f27 (diff)
downloadvyos-1x-26677aa3ce312a5b980ea88d57feebd09e39fd98.tar.gz
vyos-1x-26677aa3ce312a5b980ea88d57feebd09e39fd98.zip
Merge branch 'current' into equuleus
Diffstat (limited to 'python')
-rw-r--r--python/vyos/migrator.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/python/vyos/migrator.py b/python/vyos/migrator.py
index 86e1af183..f05228041 100644
--- a/python/vyos/migrator.py
+++ b/python/vyos/migrator.py
@@ -80,13 +80,18 @@ class Migrator(object):
"""
self._log_file = os.path.join(vyos.defaults.directories['config'],
'vyos-migrate.log')
+ # on creation, allow write permission for cfg_group;
+ # restore original umask on exit
+ mask = os.umask(0o113)
try:
log = open('{0}'.format(self._log_file), 'w')
log.write("List of executed migration scripts:\n")
except Exception as e:
+ os.umask(mask)
print("Logging error: {0}".format(e))
return None
+ os.umask(mask)
return log
def run_migration_scripts(self, config_file_versions, system_versions):