summaryrefslogtreecommitdiffstats
path: root/ipalib
diff options
context:
space:
mode:
authorJason Gerard DeRose <jderose@redhat.com>2009-01-30 20:53:32 -0700
committerRob Crittenden <rcritten@redhat.com>2009-02-03 15:29:05 -0500
commitc2b0c801400fcb59be8687f9faf061aa85bcffd2 (patch)
tree434634987f8888ad5b0b66db78627f9e37206c84 /ipalib
parent91ca06f079f4de1ca5e6c60cfdf7aae75f60821b (diff)
downloadfreeipa-c2b0c801400fcb59be8687f9faf061aa85bcffd2.tar.gz
freeipa-c2b0c801400fcb59be8687f9faf061aa85bcffd2.tar.xz
freeipa-c2b0c801400fcb59be8687f9faf061aa85bcffd2.zip
Started work on a much simplified mod_python server
Diffstat (limited to 'ipalib')
-rw-r--r--ipalib/config.py9
-rw-r--r--ipalib/errors2.py22
-rw-r--r--ipalib/plugable.py2
-rw-r--r--ipalib/plugins/f_ra.py10
4 files changed, 33 insertions, 10 deletions
diff --git a/ipalib/config.py b/ipalib/config.py
index 735cf0a1f..42d7ab578 100644
--- a/ipalib/config.py
+++ b/ipalib/config.py
@@ -432,8 +432,9 @@ class Env(object):
self.site_packages = path.dirname(self.ipalib)
self.script = path.abspath(sys.argv[0])
self.bin = path.dirname(self.script)
- self.home = path.abspath(os.environ['HOME'])
- self.dot_ipa = path.join(self.home, '.ipa')
+ self.home = os.environ.get('HOME', None)
+ self.etc = path.join('/', 'etc', 'ipa')
+ self.dot_ipa = self._join('home', '.ipa')
self._merge(**overrides)
if 'in_tree' not in self:
if self.bin == self.site_packages and \
@@ -454,6 +455,10 @@ class Env(object):
if 'conf_dir' not in self:
self.conf_dir = base
+ def _join(self, key, *parts):
+ if key in self and self[key] is not None:
+ return path.join(self[key], *parts)
+
def _finalize_core(self, **defaults):
"""
Complete initialization of standard IPA environment.
diff --git a/ipalib/errors2.py b/ipalib/errors2.py
index d1ece25d5..ebb1fdaf6 100644
--- a/ipalib/errors2.py
+++ b/ipalib/errors2.py
@@ -410,9 +410,26 @@ class KerberosError(AuthenticationError):
errno = 1100
+class CCacheError(KerberosError):
+ """
+ **1101** Raised when sever does not recieve Kerberose credentials.
+
+ For example:
+
+ >>> raise CCacheError()
+ Traceback (most recent call last):
+ ...
+ CCacheError: did not receive Kerberos credentials
+
+ """
+
+ errno = 1101
+ format = _('did not receive Kerberos credentials')
+
+
class ServiceError(KerberosError):
"""
- **1101** Raised when service is not found in Kerberos DB.
+ **1102** Raised when service is not found in Kerberos DB.
For example:
@@ -420,10 +437,9 @@ class ServiceError(KerberosError):
Traceback (most recent call last):
...
ServiceError: Service 'HTTP@localhost' not found in Kerberos database
-
"""
- errno = 1101
+ errno = 1102
format = _('Service %(service)r not found in Kerberos database')
diff --git a/ipalib/plugable.py b/ipalib/plugable.py
index 5a0076972..cf2919f1f 100644
--- a/ipalib/plugable.py
+++ b/ipalib/plugable.py
@@ -561,6 +561,8 @@ class API(DictProxy):
# Add file handler:
if self.env.mode in ('dummy', 'unit_test'):
return # But not if in unit-test mode
+ if self.env.log is None:
+ return
log_dir = path.dirname(self.env.log)
if not path.isdir(log_dir):
try:
diff --git a/ipalib/plugins/f_ra.py b/ipalib/plugins/f_ra.py
index 7ac84e65f..6a5b3984c 100644
--- a/ipalib/plugins/f_ra.py
+++ b/ipalib/plugins/f_ra.py
@@ -41,7 +41,7 @@ class request_certificate(Command):
else:
textui.print_plain('Failed to submit a certificate request.')
-api.register(request_certificate)
+#api.register(request_certificate)
class get_certificate(Command):
@@ -58,7 +58,7 @@ class get_certificate(Command):
else:
textui.print_plain('Failed to obtain a certificate.')
-api.register(get_certificate)
+#api.register(get_certificate)
class check_request_status(Command):
@@ -76,7 +76,7 @@ class check_request_status(Command):
else:
textui.print_plain('Failed to retrieve a request status.')
-api.register(check_request_status)
+#api.register(check_request_status)
class revoke_certificate(Command):
@@ -97,7 +97,7 @@ class revoke_certificate(Command):
else:
textui.print_plain('Failed to revoke a certificate.')
-api.register(revoke_certificate)
+#api.register(revoke_certificate)
class take_certificate_off_hold(Command):
@@ -114,4 +114,4 @@ class take_certificate_off_hold(Command):
else:
textui.print_plain('Failed to take a revoked certificate off hold.')
-api.register(take_certificate_off_hold)
+#api.register(take_certificate_off_hold)