summaryrefslogtreecommitdiffstats
path: root/ipalib/errors.py
diff options
context:
space:
mode:
authorDavid Kupka <dkupka@redhat.com>2016-06-21 14:21:22 +0200
committerJan Cholasta <jcholast@redhat.com>2016-06-21 15:11:19 +0200
commit4b97cabb52585e9f58a2f2034ba71fd7e8d678d7 (patch)
treea3f0fd2996046e11c1b304561608288eca653121 /ipalib/errors.py
parent034a111972df7e1b2db71ea30440b36dc93e2c7b (diff)
downloadfreeipa-4b97cabb52585e9f58a2f2034ba71fd7e8d678d7.tar.gz
freeipa-4b97cabb52585e9f58a2f2034ba71fd7e8d678d7.tar.xz
freeipa-4b97cabb52585e9f58a2f2034ba71fd7e8d678d7.zip
schema: Add known_fingerprints option to schema command
When client requests schema it can list fingerprints of cached schemas and server responds with SchemaUpToDate exception specifying fingeprint of schema to use. https://fedorahosted.org/freeipa/ticket/4739 Reviewed-By: Jan Cholasta <jcholast@redhat.com>
Diffstat (limited to 'ipalib/errors.py')
-rw-r--r--ipalib/errors.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/ipalib/errors.py b/ipalib/errors.py
index bd2d314a4..10491a942 100644
--- a/ipalib/errors.py
+++ b/ipalib/errors.py
@@ -1820,6 +1820,24 @@ class CertificateInvalidError(CertificateError):
format = _('%(name)s certificate is not valid')
+class SchemaUpToDate(ExecutionError):
+ """
+ **4311** Raised by server when client asks for metadata but
+ already has current version. Exception's attribute 'fingerprint'
+ identitfies schema version to use. Attribute 'ttl' specifies how
+ long (in seconds) before client should check for schema update.
+
+ For example:
+ >>> raise SchemaUpToDate(fingerprint=u'deadbeef', ttl=3600)
+ Traceback (most recent call last):
+ ...
+ SchemaUpToDate: Schema is up to date (FP 'deadbeef', TTL 3600 s)
+ """
+
+ errno = 4311
+ format = _("Schema is up to date (FP '%(fingerprint)s', TTL %(ttl)s s)")
+
+
class DNSError(ExecutionError):
"""
**4400** Base class for DNS execution errors (*4400 - 4499*).