mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
config: provide defaults for xmlrpc_uri
, ldap_uri
and basedn
Derive the default value of `xmlrpc_uri` and `ldap_uri` from `server`. Derive the default value of `basedn` from `domain`. Reviewed-By: Martin Babinsky <mbabinsk@redhat.com> Reviewed-By: Christian Heimes <cheimes@redhat.com>
This commit is contained in:
parent
3f6411a49c
commit
ba3963b4dc
@ -579,6 +579,20 @@ class Env(object):
|
|||||||
if 'log' not in self:
|
if 'log' not in self:
|
||||||
self.log = self._join('logdir', '%s.log' % self.context)
|
self.log = self._join('logdir', '%s.log' % self.context)
|
||||||
|
|
||||||
|
if 'basedn' not in self and 'domain' in self:
|
||||||
|
self.basedn = DN(*(('dc', dc) for dc in self.domain.split('.')))
|
||||||
|
|
||||||
|
# Derive xmlrpc_uri from server
|
||||||
|
# (Note that this is done before deriving jsonrpc_uri from xmlrpc_uri
|
||||||
|
# and server from jsonrpc_uri so that when only server or xmlrpc_uri
|
||||||
|
# is specified, all 3 keys have a value.)
|
||||||
|
if 'xmlrpc_uri' not in self and 'server' in self:
|
||||||
|
self.xmlrpc_uri = 'https://{}/ipa/xml'.format(self.server)
|
||||||
|
|
||||||
|
# Derive ldap_uri from server
|
||||||
|
if 'ldap_uri' not in self and 'server' in self:
|
||||||
|
self.ldap_uri = 'ldap://{}'.format(self.server)
|
||||||
|
|
||||||
# Derive jsonrpc_uri from xmlrpc_uri
|
# Derive jsonrpc_uri from xmlrpc_uri
|
||||||
if 'jsonrpc_uri' not in self:
|
if 'jsonrpc_uri' not in self:
|
||||||
if 'xmlrpc_uri' in self:
|
if 'xmlrpc_uri' in self:
|
||||||
|
@ -134,8 +134,9 @@ DEFAULT_CONFIG = (
|
|||||||
# Following values do not have any reasonable default.
|
# Following values do not have any reasonable default.
|
||||||
# Do not initialize them so the code which depends on them blows up early
|
# Do not initialize them so the code which depends on them blows up early
|
||||||
# and does not do crazy stuff with default values instead of real ones.
|
# and does not do crazy stuff with default values instead of real ones.
|
||||||
|
# ('server', 'localhost'),
|
||||||
# ('xmlrpc_uri', 'http://localhost:8888/ipa/xml'),
|
# ('xmlrpc_uri', 'http://localhost:8888/ipa/xml'),
|
||||||
# jsonrpc_uri is set in Env._finalize_core()
|
# ('jsonrpc_uri', 'http://localhost:8888/ipa/json'),
|
||||||
# ('ldap_uri', 'ldap://localhost:389'),
|
# ('ldap_uri', 'ldap://localhost:389'),
|
||||||
|
|
||||||
('rpc_protocol', 'jsonrpc'),
|
('rpc_protocol', 'jsonrpc'),
|
||||||
@ -245,8 +246,6 @@ DEFAULT_CONFIG = (
|
|||||||
('in_server', object), # Whether or not running in-server (bool)
|
('in_server', object), # Whether or not running in-server (bool)
|
||||||
('logdir', object), # Directory containing log files
|
('logdir', object), # Directory containing log files
|
||||||
('log', object), # Path to context specific log file
|
('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()
|
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
2
makeaci
2
makeaci
@ -99,8 +99,6 @@ def main(options):
|
|||||||
basedn=DN('dc=ipa,dc=example'),
|
basedn=DN('dc=ipa,dc=example'),
|
||||||
realm='IPA.EXAMPLE',
|
realm='IPA.EXAMPLE',
|
||||||
domain="example.com",
|
domain="example.com",
|
||||||
xmlrpc_uri="http://localhost:8888/ipa/xml",
|
|
||||||
ldap_uri="ldap://localhost:389",
|
|
||||||
)
|
)
|
||||||
|
|
||||||
from ipaserver.install.plugins import update_managed_permissions
|
from ipaserver.install.plugins import update_managed_permissions
|
||||||
|
4
makeapi
4
makeapi
@ -40,7 +40,6 @@ from ipalib.parameters import Param
|
|||||||
from ipalib.output import Output
|
from ipalib.output import Output
|
||||||
from ipalib.text import Gettext, NGettext, ConcatenatedLazyText
|
from ipalib.text import Gettext, NGettext, ConcatenatedLazyText
|
||||||
from ipalib.capabilities import capabilities
|
from ipalib.capabilities import capabilities
|
||||||
from ipapython.dn import DN
|
|
||||||
|
|
||||||
API_FILE='API.txt'
|
API_FILE='API.txt'
|
||||||
|
|
||||||
@ -514,11 +513,8 @@ def main():
|
|||||||
enable_ra=True,
|
enable_ra=True,
|
||||||
mode='developer',
|
mode='developer',
|
||||||
plugins_on_demand=False,
|
plugins_on_demand=False,
|
||||||
basedn=DN(('dc', 'example'), ('dc', 'com')),
|
|
||||||
realm="EXAMPLE.COM",
|
realm="EXAMPLE.COM",
|
||||||
domain="example.com",
|
domain="example.com",
|
||||||
xmlrpc_uri="http://localhost:8888/ipa/xml",
|
|
||||||
ldap_uri="ldap://localhost:389",
|
|
||||||
)
|
)
|
||||||
|
|
||||||
api.bootstrap(**cfg)
|
api.bootstrap(**cfg)
|
||||||
|
@ -101,7 +101,9 @@ ipa_class_members = {
|
|||||||
'xmlrpc_uri',
|
'xmlrpc_uri',
|
||||||
'validate_api',
|
'validate_api',
|
||||||
'startup_traceback',
|
'startup_traceback',
|
||||||
'verbose'
|
'verbose',
|
||||||
|
'server',
|
||||||
|
{'domain': dir(str)},
|
||||||
] + LOGGING_ATTRS,
|
] + LOGGING_ATTRS,
|
||||||
'ipalib.errors.ACIError': [
|
'ipalib.errors.ACIError': [
|
||||||
'info',
|
'info',
|
||||||
|
Loading…
Reference in New Issue
Block a user