summaryrefslogtreecommitdiff
path: root/python/vyos
diff options
context:
space:
mode:
Diffstat (limited to 'python/vyos')
-rw-r--r--python/vyos/migrator.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/python/vyos/migrator.py b/python/vyos/migrator.py
index 37c4e5902..4574bb6d1 100644
--- a/python/vyos/migrator.py
+++ b/python/vyos/migrator.py
@@ -170,9 +170,15 @@ class Migrator(object):
"""
Write component versions to a json file
"""
+ mask = os.umask(0o113)
version_file = vyos.defaults.component_version_json
- with open(version_file, 'w') as f:
- f.write(json.dumps(component_versions, indent=2, sort_keys=True))
+ try:
+ with open(version_file, 'w') as f:
+ f.write(json.dumps(component_versions, indent=2, sort_keys=True))
+ except OSError:
+ pass
+ finally:
+ os.umask(mask)
def run(self):
"""