def get_instances_with_cached_ips(orig_func, *args, **kwargs):
 instances = orig_func(*args, **kwargs)
 if isinstance(instances, list):
  for instance in instances:
   instance['info_cache'] = {'network_info': get_fake_cache()}
 else:
  instances['info_cache'] = {'network_info': get_fake_cache()}
 return instances

def get_instances_with_cached_ips ( orig_func , * args , ** kwargs ) : instances = orig_func ( * args , ** kwargs ) if isinstance ( instances , list ) : for instance in instances : instance [ 'info_cache' ] = { 'network_info' : get_fake_cache ( ) } else : instances [ 'info_cache' ] = { 'network_info' : get_fake_cache ( ) } return instances
kludge the cache into instance(s) without having to create db entries .