diff options
| author | Jan Cholasta <jcholast@redhat.com> | 2015-06-04 11:59:22 +0000 |
|---|---|---|
| committer | Jan Cholasta <jcholast@redhat.com> | 2015-06-08 15:33:36 +0000 |
| commit | 08229a0c5457d4e0c13d6b02a1f38f60ea787856 (patch) | |
| tree | 7e0d0318cc2b33b4fdbfa235ad06d81ae013a3c0 /ipaserver | |
| parent | 4c70590c2a78b6d2cbfed585502442f733f26389 (diff) | |
| download | freeipa-08229a0c5457d4e0c13d6b02a1f38f60ea787856.tar.gz freeipa-08229a0c5457d4e0c13d6b02a1f38f60ea787856.tar.xz freeipa-08229a0c5457d4e0c13d6b02a1f38f60ea787856.zip | |
install: Move private_ccache from ipaserver to ipapython
https://fedorahosted.org/freeipa/ticket/4468
Reviewed-By: Martin Basti <mbasti@redhat.com>
Diffstat (limited to 'ipaserver')
| -rw-r--r-- | ipaserver/dcerpc.py | 4 | ||||
| -rw-r--r-- | ipaserver/install/installutils.py | 22 | ||||
| -rw-r--r-- | ipaserver/install/server/install.py | 3 |
3 files changed, 3 insertions, 26 deletions
diff --git a/ipaserver/dcerpc.py b/ipaserver/dcerpc.py index 44689cc96..a1c57d22c 100644 --- a/ipaserver/dcerpc.py +++ b/ipaserver/dcerpc.py @@ -590,7 +590,7 @@ class DomainValidator(object): (ccache_name, principal) = self.kinit_as_http(info['dns_domain']) if ccache_name: - with installutils.private_ccache(path=ccache_name): + with ipautil.private_ccache(path=ccache_name): entries = None try: @@ -1093,7 +1093,7 @@ def fetch_domains(api, mydomain, trustdomain, creds=None): td.creds = credentials.Credentials() td.creds.set_kerberos_state(credentials.MUST_USE_KERBEROS) if ccache_name: - with installutils.private_ccache(path=ccache_name): + with ipautil.private_ccache(path=ccache_name): td.creds.guess(td.parm) td.creds.set_workstation(domain_validator.flatname) domains = communicate(td) diff --git a/ipaserver/install/installutils.py b/ipaserver/install/installutils.py index ef95b4907..9d0998f5f 100644 --- a/ipaserver/install/installutils.py +++ b/ipaserver/install/installutils.py @@ -915,28 +915,6 @@ def load_pkcs12(cert_files, key_password, key_nickname, ca_cert_files, return out_file, out_password, ca_cert -@contextmanager -def private_ccache(path=None): - - if path is None: - (desc, path) = tempfile.mkstemp(prefix='krbcc') - os.close(desc) - - original_value = os.environ.get('KRB5CCNAME', None) - - os.environ['KRB5CCNAME'] = path - - try: - yield - finally: - if original_value is not None: - os.environ['KRB5CCNAME'] = original_value - else: - os.environ.pop('KRB5CCNAME') - - if os.path.exists(path): - os.remove(path) - @contextmanager def stopped_service(service, instance_name=""): diff --git a/ipaserver/install/server/install.py b/ipaserver/install/server/install.py index faa96127a..7bcb5d176 100644 --- a/ipaserver/install/server/install.py +++ b/ipaserver/install/server/install.py @@ -28,8 +28,7 @@ from ipaserver.install import ( otpdinstance, replication, service, sysupgrade) from ipaserver.install.installutils import ( IPA_MODULES, BadHostError, get_fqdn, get_server_ip_address, - is_ipa_configured, load_pkcs12, private_ccache, - read_password, verify_fqdn) + is_ipa_configured, load_pkcs12, read_password, verify_fqdn) from ipaserver.plugins.ldap2 import ldap2 try: from ipaserver.install import adtrustinstance |
