#NEWLINE# @ property #NEWLINE# def container_id( self ) : #NEWLINE# #INDENT# "\n        Find a container id\n\n        If one isn't already set, we ask docker for the container whose name is\n        the same as the recorded container_name\n        " #NEWLINE# if getattr ( self , '_container_id' , None ) : #NEWLINE# #INDENT# return self . _container_id #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# containers = self . harpoon . docker_context . containers ( all = True ) #NEWLINE# #UNINDENT# except ValueError : #NEWLINE# #INDENT# log . warning ( 'Failed to get a list of active docker files' ) #NEWLINE# containers = [ ] #NEWLINE# #UNINDENT# self . _container_id = None #NEWLINE# for container in containers : #NEWLINE# #INDENT# if any ( ( ( self . name in container . get ( 'Names' , [ ] ) ) for name in ( self . container_name , '/{0}' . format ( self . container_name ) ) ) ) : #NEWLINE# #INDENT# self . _container_id = container [ 'Id' ] #NEWLINE# break #NEWLINE# #UNINDENT# #UNINDENT# return self . _container_id