def wait_for_scrub(path):
 http = httplib2.Http()
 wait_for = 300
 check_every = 15
 for _ in xrange((wait_for / check_every)):
  time.sleep(check_every)
  (response, content) = http.request(path, 'HEAD')
  if ((response['x-image-meta-status'] == 'deleted') and (response['x-image-meta-deleted'] == 'True')):
   break
  else:
   continue
 else:
  self.fail('image was never scrubbed')

def wait_for_scrub ( path ) : http = httplib2 . Http ( ) wait_for = 300 check_every = 15 for _ in xrange ( ( wait_for / check_every ) ) : time . sleep ( check_every ) ( response , content ) = http . request ( path , 'HEAD' ) if ( ( response [ 'x-image-meta-status' ] == 'deleted' ) and ( response [ 'x-image-meta-deleted' ] == 'True' ) ) : break else : continue else : self . fail ( 'image was never scrubbed' )
note the build servers sometimes take longer than 15 seconds to scrub .