summaryrefslogtreecommitdiffstats
path: root/ipaplatform
diff options
context:
space:
mode:
authorDavid Kupka <dkupka@redhat.com>2016-07-26 13:35:22 +0200
committerJan Cholasta <jcholast@redhat.com>2016-08-03 16:32:39 +0200
commit229e2a1ed9ea9877cb5e879fadd99f9040f77c96 (patch)
treef4b807ff2adc520dab5c98431ae6499beb5c92dc /ipaplatform
parente76b0bbbcc77aa0473f209beeb538c8313172c66 (diff)
downloadfreeipa-229e2a1ed9ea9877cb5e879fadd99f9040f77c96.tar.gz
freeipa-229e2a1ed9ea9877cb5e879fadd99f9040f77c96.tar.xz
freeipa-229e2a1ed9ea9877cb5e879fadd99f9040f77c96.zip
compat: Save server's API version in for pre-schema servers
When client comunicates with server that doesn't support 'schema' command it needs to determine its api version to be able to use the right compat code. Storing information about server version reduces the need to call 'env' or 'ping' command only to first time the server is contacted. https://fedorahosted.org/freeipa/ticket/6069 Reviewed-By: Jan Cholasta <jcholast@redhat.com>
Diffstat (limited to 'ipaplatform')
-rw-r--r--ipaplatform/base/paths.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/ipaplatform/base/paths.py b/ipaplatform/base/paths.py
index bb0071a8e..b1fedf5d7 100644
--- a/ipaplatform/base/paths.py
+++ b/ipaplatform/base/paths.py
@@ -21,6 +21,8 @@
This base platform module exports default filesystem paths.
'''
+import os
+
class BasePathNamespace(object):
BASH = "/bin/bash"
@@ -353,4 +355,17 @@ class BasePathNamespace(object):
IPA_CUSTODIA_AUDIT_LOG = '/var/log/ipa-custodia.audit.log'
IPA_GETKEYTAB = '/usr/sbin/ipa-getkeytab'
+ @property
+ def USER_CACHE_PATH(self):
+ return (
+ os.environ.get('XDG_CACHE_HOME') or
+ os.path.join(
+ os.environ.get(
+ 'HOME',
+ os.path.expanduser('~')
+ ),
+ '.cache'
+ )
+ )
+
path_namespace = BasePathNamespace