mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
env: Add 'server' variable to api.env
https://fedorahosted.org/freeipa/ticket/4739 Reviewed-By: Jan Cholasta <jcholast@redhat.com>
This commit is contained in:
committed by
Jan Cholasta
parent
bf91c0f938
commit
65aa2d48ff
@@ -563,6 +563,15 @@ class Env(object):
|
||||
self.jsonrpc_uri = urlunparse((
|
||||
scheme, netloc, uripath, params, query, fragment))
|
||||
|
||||
if 'server' not in self:
|
||||
if 'jsonrpc_uri' in self:
|
||||
jsonrpc_uri = self.jsonrpc_uri
|
||||
else:
|
||||
jsonrpc_uri = defaults.get('jsonrpc_uri')
|
||||
if jsonrpc_uri:
|
||||
parsed = urlparse(jsonrpc_uri)
|
||||
self.server = parsed.netloc
|
||||
|
||||
self._merge(**defaults)
|
||||
|
||||
def _finalize(self, **lastchance):
|
||||
|
||||
@@ -231,6 +231,7 @@ DEFAULT_CONFIG = (
|
||||
('logdir', object), # Directory containing log files
|
||||
('log', object), # Path to context specific log file
|
||||
('jsonrpc_uri', object), # derived from xmlrpc_uri in Env._finalize_core()
|
||||
('server', object), # derived from jsonrpc_uri in Env._finalize_core()
|
||||
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user