2015-07-15 04:17:14 -05:00
|
|
|
#
|
|
|
|
# Copyright (C) 2015 FreeIPA Contributors see COPYING for license
|
|
|
|
#
|
|
|
|
|
2016-03-03 08:12:19 -06:00
|
|
|
from ipalib import Registry
|
2015-07-15 04:17:14 -05:00
|
|
|
from ipalib import Updater
|
|
|
|
from ipaserver.install import certs, cainstance
|
|
|
|
from ipaserver.install import ldapupdate
|
|
|
|
from ipaplatform.paths import paths
|
|
|
|
|
2016-03-03 08:12:19 -06:00
|
|
|
register = Registry()
|
2015-07-15 04:17:14 -05:00
|
|
|
|
2016-03-03 08:12:19 -06:00
|
|
|
|
|
|
|
@register()
|
2015-07-15 04:17:14 -05:00
|
|
|
class update_ca_topology(Updater):
|
|
|
|
"""
|
|
|
|
Updates CA topology configuration entries
|
|
|
|
"""
|
|
|
|
|
|
|
|
def execute(self, **options):
|
|
|
|
|
|
|
|
ca = cainstance.CAInstance(self.api.env.realm, certs.NSS_DIR)
|
|
|
|
if not ca.is_configured():
|
|
|
|
self.log.debug("CA is not configured on this host")
|
|
|
|
return False, []
|
|
|
|
|
|
|
|
ld = ldapupdate.LDAPUpdate(ldapi=True, sub_dict={
|
|
|
|
'SUFFIX': self.api.env.basedn,
|
|
|
|
'FQDN': self.api.env.host,
|
|
|
|
})
|
2015-11-25 05:42:02 -06:00
|
|
|
|
|
|
|
ld.update([paths.CA_TOPOLOGY_ULDIF])
|
2015-07-15 04:17:14 -05:00
|
|
|
|
|
|
|
return False, []
|