Lines 54-63
def get_connection(self):
|
Link Here
|
---|
|
54 |
except (OSError, IOError) as exc: |
54 |
except (OSError, IOError) as exc: |
55 |
self.log('Could not read UMC server credentials: %s' % (exc,)) |
55 |
self.log('Could not read UMC server credentials: %s' % (exc,)) |
56 |
raise cherrypy.HTTPError(503, 'Could not authenticate at Univention Management Console service.') |
56 |
raise cherrypy.HTTPError(503, 'Could not authenticate at Univention Management Console service.') |
57 |
status, response = connection.auth({'username': username, 'password': password}) |
57 |
connection._headers['Authorization'] = 'basic %s' % ('%s:%s' % (username, password)).encode('base64').rstrip() |
58 |
if status != 200: |
|
|
59 |
self.log('Authentication failed: %r' % (response,)) |
60 |
raise cherrypy.HTTPError(503, 'Could not authenticate at Univention Management Console service: %s' % (format_status(status),)) |
61 |
return connection |
58 |
return connection |
62 |
|
59 |
|
63 |
def umc_request(self, url, data): |
60 |
def umc_request(self, url, data): |