On 01/07/16 07:59, David Kupka wrote:
https://fedorahosted.org/freeipa/ticket/4739


Offline NACK from Honza, attaching updated patch.

--
David Kupka
From 3d991e41e9e215c154994948e7d5360f82ea2e29 Mon Sep 17 00:00:00 2001
From: David Kupka <dku...@redhat.com>
Date: Fri, 1 Jul 2016 07:50:08 +0200
Subject: [PATCH] schema: Perform the check for schema update when
 force_schema_check is True

https://fedorahosted.org/freeipa/ticket/4739
---
 ipaclient/remote_plugins/schema.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/ipaclient/remote_plugins/schema.py b/ipaclient/remote_plugins/schema.py
index a54d4eb777d3fa3d0a1dd6223eca2efeb8db4fbd..89aaeac516b9ee5afa0dd9b6d853d4ed1cf3b801 100644
--- a/ipaclient/remote_plugins/schema.py
+++ b/ipaclient/remote_plugins/schema.py
@@ -496,8 +496,13 @@ class Schema(object):
                     logger.warning('Failed to load server properties: {}'
                                    ''.format(e))
 
-        if no_info or exp < time.time() or not Schema._in_cache(fp):
+        force_check = ((not getattr(self, '_schema_checked', False)) and
+                       self._api.env.force_schema_check)
+
+        if (force_check or
+                no_info or exp < time.time() or not Schema._in_cache(fp)):
             (fp, exp) = self._get_schema()
+            self._schema_checked = True
             _ensure_dir_created(SERVERS_DIR)
             try:
                 with self._open_server_info(self._api.env.server, 'w') as sc:
-- 
2.7.4

-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

Reply via email to