#NEWLINE# @ staticmethod #NEWLINE# def registry_for_container( container , registries = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) : #NEWLINE# #INDENT# image = container . get_image_details ( ) #NEWLINE# if ( image [ 'repository' ] . find ( '/' ) <= 0 ) : #NEWLINE# #INDENT# return None #NEWLINE# #UNINDENT# ( registry , repo_name ) = image [ 'repository' ] . split ( '/' , 1 ) #NEWLINE# if ( registry not in registries ) : #NEWLINE# #INDENT# for ( name , info ) in registries . items ( ) : #NEWLINE# #INDENT# fqdn = urlparse . urlparse ( info [ 'registry' ] ) . netloc #NEWLINE# if ( ( registry == fqdn ) or ( registry == fqdn . split ( ':' ) [ 0 ] ) ) : #NEWLINE# #INDENT# registry = name #NEWLINE# break #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return registries . get ( name )