diff --git a/statusd.py b/statusd.py index 382d855..8fc7295 100755 --- a/statusd.py +++ b/statusd.py @@ -118,7 +118,9 @@ def change_status(raw_data, api): if data != False: status, timestamp = set_values(raw_data) if os.access(api, os.W_OK): + logging.debug('API file is writable') with open(api, 'w') as api_file: + logging.debug('API file open successfull') for line in data.splitlines(): if line.strip().startswith('"state":'): edit = True @@ -134,6 +136,8 @@ def change_status(raw_data, api): logging.error('Failed to write line to API file') logging.error('Line: {}'.format(line)) logging.error('{}'.format(e)) + logging.error('Failed to open API file') + logging.error('API file is not writable. No permissions?') logging.info('Status successfull changed to {}'.format(status)) return True return False