hotfix for various aspect of farm rendering

This commit is contained in:
Ondrej Samohel 2019-11-06 14:06:24 +01:00
parent 85c9422a25
commit 50438283cd
No known key found for this signature in database
GPG key ID: 8A29C663C672C2B7
11 changed files with 188 additions and 22 deletions

View file

@ -93,7 +93,7 @@ class MusterModule:
'password': password
}
api_entry = '/api/login'
response = requests.post(
response = self._requests_post(
MUSTER_REST_URL + api_entry, params=params)
if response.status_code != 200:
self.log.error(
@ -125,3 +125,17 @@ class MusterModule:
Show dialog to enter credentials
"""
self.widget_login.show()
def _requests_post(self, *args, **kwargs):
""" Wrapper for requests, disabling SSL certificate validation if
DONT_VERIFY_SSL environment variable is found. This is useful when
Deadline or Muster server are running with self-signed certificates
and their certificate is not added to trusted certificates on
client machines.
WARNING: disabling SSL certificate validation is defeating one line
of defense SSL is providing and it is not recommended.
"""
if 'verify' not in kwargs:
kwargs['verify'] = False if os.getenv("PYPE_DONT_VERIFY_SSL", True) else True # noqa
return requests.post(*args, **kwargs)