#NEWLINE# def login( self , docker_context , image_name , is_pushing = False , global_docker = False ) : #NEWLINE# #INDENT# registry = urlparse ( 'https://{0}' . format ( image_name ) ) . netloc #NEWLINE# if ( registry in self . registries ) : #NEWLINE# #INDENT# if is_pushing : #NEWLINE# #INDENT# authenticator = self . registries [ registry ] [ 'writing' ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# authenticator = self . registries [ registry ] [ 'reading' ] #NEWLINE# #UNINDENT# if ( authenticator is not NotSpecified ) : #NEWLINE# #INDENT# ( username , password ) = authenticator . creds #NEWLINE# if global_docker : #NEWLINE# #INDENT# cmd = 'docker login -u {0} -p {1} -e {2} {3}' . format ( is_pushing , password , 'emailnotneeded@goawaydocker.com' , registry ) #NEWLINE# os . system ( cmd ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# docker_context . login ( username , password , registry = registry , reauth = True )