Skip to content

Commit

Permalink
check for read-only filesystem and exit if write needed and cannot. F…
Browse files Browse the repository at this point in the history
…ixes #146
  • Loading branch information
dirtycajunrice committed Aug 9, 2019
1 parent 378e8d6 commit cca283d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 126 deletions.
126 changes: 0 additions & 126 deletions Jenkinsfile

This file was deleted.

4 changes: 4 additions & 0 deletions varken/iniparser.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from os import W_OK, access
from shutil import copyfile
from os import environ as env
from logging import getLogger
Expand Down Expand Up @@ -77,6 +78,9 @@ def write_file(self, inifile):
file_path = join(self.data_folder, ini)
if exists(file_path):
self.logger.debug('Writing to %s', inifile)
if not access(file_path, W_OK):
self.logger.error("Config file is incomplete and read-only. Exiting.")
exit(1)
with open(file_path, 'w') as config_ini:
self.config.write(config_ini)
else:
Expand Down

0 comments on commit cca283d

Please sign in to comment.