schema: Perform the check for schema update when force_schema_check is True

https://fedorahosted.org/freeipa/ticket/4739

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
This commit is contained in:
David Kupka 2016-07-01 07:50:08 +02:00 committed by Jan Cholasta
parent 4844eaec19
commit cea1f33606

View File

@ -414,8 +414,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: