'NOTE(jkoelker) The build servers sometimes take longer than 15 seconds
to scrub. Give it up to 5 min, checking checking every 15 seconds.
When/if it flips to deleted, bail immediately.'

def wait_for_scrub(self, path, headers=None):

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