#NEWLINE# def _create_glance_client( context , host , port ) : #NEWLINE# #INDENT# if ( context . strategy == 'keystone' ) : #NEWLINE# #INDENT# creds = { #NEWLINE# #INDENT# 'strategy' : 'keystone' , #NEWLINE# 'username' : context . user_id , #NEWLINE# 'tenant' : context . project_id , #NEWLINE# #UNINDENT# } #NEWLINE# glance_client = GlanceClient ( host , port , auth_tok = context . auth_token , creds = creds ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# glance_client = GlanceClient ( host , port ) #NEWLINE# #UNINDENT# return glance_client