Skip to content
This repository has been archived by the owner on Dec 18, 2023. It is now read-only.

catch Permission denied to prevent json exception #43

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion check_mk_web_api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def make_request(self, action, query_params=None, data=None):

body = response.read().decode()

if body.startswith('Authentication error:'):
if re.match('(^Authentication error:|^Permission denied: Invalid automation secret)', body):
raise CheckMkWebApiAuthenticationException(body)

if 'output_format' in query_params and query_params['output_format'] == 'python':
Expand Down