def image_list(id=None, profile=None, name=None):
 g_client = _auth(profile)
 ret = []
 for image in g_client.images.list():
  if ((id is None) and (name is None)):
   _add_image(ret, image)
  else:
   if ((id is not None) and (id == image.id)):
    _add_image(ret, image)
    return ret
   if (name == image.name):
    if ((name in ret) and (CUR_VER < BORON)):
     return {'result': False, 'comment': 'More than one image with name "{0}"'.format(name)}
    _add_image(ret, image)
 log.debug('Returning images: {0}'.format(ret))
 return ret

def image_list ( id = None , profile = None , name = None ) : g_client = _auth ( profile ) ret = [ ] for image in g_client . images . list ( ) : if ( ( id is None ) and ( name is None ) ) : _add_image ( ret , image ) else : if ( ( id is not None ) and ( id == image . id ) ) : _add_image ( ret , image ) return ret if ( name == image . name ) : if ( ( name in ret ) and ( CUR_VER < BORON ) ) : return { 'result' : False , 'comment' : 'More than one image with name "{0}"' . format ( name ) } _add_image ( ret , image ) log . debug ( 'Returning images: {0}' . format ( ret ) ) return ret
return a list of available images if a name is provided .