@ -430,13 +430,10 @@ class AnsibleDockerClient(Client):
Pull an image
Pull an image
'''
'''
self . log ( " Pulling image %s : %s " % ( name , tag ) )
self . log ( " Pulling image %s : %s " % ( name , tag ) )
alreadyToLatest = False
old_tag = self . find_image ( name , tag )
try :
try :
for line in self . pull ( name , tag = tag , stream = True , decode = True ) :
for line in self . pull ( name , tag = tag , stream = True , decode = True ) :
self . log ( line , pretty_print = True )
self . log ( line , pretty_print = True )
if line . get ( ' status ' ) :
if line . get ( ' status ' ) . startswith ( ' Status: Image is up to date for ' ) :
alreadyToLatest = True
if line . get ( ' error ' ) :
if line . get ( ' error ' ) :
if line . get ( ' errorDetail ' ) :
if line . get ( ' errorDetail ' ) :
error_detail = line . get ( ' errorDetail ' )
error_detail = line . get ( ' errorDetail ' )
@ -448,6 +445,8 @@ class AnsibleDockerClient(Client):
except Exception as exc :
except Exception as exc :
self . fail ( " Error pulling image %s : %s - %s " % ( name , tag , str ( exc ) ) )
self . fail ( " Error pulling image %s : %s - %s " % ( name , tag , str ( exc ) ) )
return self . find_image ( name , tag ) , alreadyToLatest
new_tag = self . find_image ( name , tag )
return new_tag , old_tag == new_tag