Enable ipa_memcached when upgrading

Add support for autobind to services. This is a bit of a special case
so I currently require the caller to specify ldapi separately. It only
makes sense to do this only in upgrade cases.

Also uninstall ipa_memcached when uninstalling the server.

https://fedorahosted.org/freeipa/ticket/2399
This commit is contained in:
Rob Crittenden
2012-02-15 16:55:59 -05:00
committed by Martin Kosek
parent 0c6e047128
commit b9bc99e43a
4 changed files with 41 additions and 9 deletions

View File

@@ -29,12 +29,15 @@ try:
from ipaserver.install import installutils
from ipaserver.install import dsinstance
from ipaserver.install import httpinstance
from ipaserver.install import memcacheinstance
from ipaserver.install import service
import ldap
import krbV
import re
import os
import shutil
import fileinput
import ipalib.errors
except ImportError:
print >> sys.stderr, """\
There was a problem importing one of the required Python modules. The
@@ -254,6 +257,15 @@ def main():
http = httpinstance.HTTPInstance()
http.remove_httpd_ccache()
memcache = memcacheinstance.MemcacheInstance()
memcache.ldapi = True
memcache.realm = krbctx.default_realm
try:
if not memcache.is_configured():
memcache.create_instance('MEMCACHE', fqdn, None, ipautil.realm_to_suffix(krbctx.default_realm))
except (ldap.ALREADY_EXISTS, ipalib.errors.DuplicateEntry):
pass
try:
if __name__ == "__main__":
sys.exit(main())