Fix for KeyError when cache is empty, change cache key prefix for dev vs. prod.

Conflicts:
	awx/settings/production.py
This commit is contained in:
Chris Church 2014-05-10 23:57:45 -04:00 committed by Matthew Jones
parent a4f5b0ae71
commit db3151a9dd
3 changed files with 5 additions and 1 deletions

View File

@ -300,7 +300,7 @@ class Host(CommonModelNameNotUnique):
if summary_data[key] is None:
rebuild_cache = True
break
if rebuild_cache:
if rebuild_cache or not summary_data:
summary_data = self.update_cached_values()
summary_data_actual = dict(all_groups=summary_data['%s_all_groups' % self.id],
groups=summary_data['%s_groups' % self.id],

View File

@ -229,6 +229,7 @@ CACHES = {
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
'LOCATION': '127.0.0.1:11211',
'TIMEOUT': 864000,
'KEY_PREFIX': 'tower_dev',
}
}

View File

@ -43,6 +43,9 @@ JOBOUTPUT_ROOT = '/var/lib/awx/job_status/'
# The heartbeat file for the tower scheduler
SCHEDULE_METADATA_LOCATION = '/var/lib/awx/.tower_cycle'
# Use different cache prefix for production vs. development.
CACHES['default']['KEY_PREFIX'] = 'tower'
LOGGING['handlers']['rotating_file'] = {
'level': 'WARNING',
'class':'logging.handlers.RotatingFileHandler',