def get_ip_info_for_instance(context, instance):
 if isinstance(instance, obj_base.NovaObject):
  nw_info = instance.info_cache.network_info
 else:
  info_cache = (instance.info_cache or {})
  nw_info = info_cache.get('network_info')
 if (not nw_info):
  nw_info = []
 return get_ip_info_for_instance_from_nw_info(nw_info)

def get_ip_info_for_instance ( context , instance ) : if isinstance ( instance , obj_base . NovaObject ) : nw_info = instance . info_cache . network_info else : info_cache = ( instance . info_cache or { } ) nw_info = info_cache . get ( 'network_info' ) if ( not nw_info ) : nw_info = [ ] return get_ip_info_for_instance_from_nw_info ( nw_info )
return a dictionary of ip information for an instance .