Try polling swift object before creating stack

Change-Id: I185d13c8c89df7ee27a7b4740d8895b3367fafa6
Closes-bug: #1491773
This commit is contained in:
Angus Salkeld
2015-10-06 13:58:34 +10:00
parent 26be3cde57
commit e9c6115ec9

View File

@@ -15,6 +15,7 @@ import json
import random
from oslo_log import log as logging
import requests
from six.moves.urllib import parse
from swiftclient import utils as swiftclient_utils
import yaml
@@ -103,7 +104,18 @@ Outputs:
tempurl = swiftclient_utils.generate_temp_url(path, timeout,
key, 'GET')
sw_url = parse.urlparse(oc.url)
return '%s://%s%s' % (sw_url.scheme, sw_url.netloc, tempurl)
full_url = '%s://%s%s' % (sw_url.scheme, sw_url.netloc, tempurl)
def download():
r = requests.get(full_url)
LOG.info('GET: %s -> %s' % (full_url, r.status_code))
return r.status_code == requests.codes.ok
# make sure that the object is available.
test.call_until_true(self.conf.build_timeout,
self.conf.build_interval, download)
return full_url
def test_nested_stack_create(self):
url = self.publish_template(self.nested_name, self.nested_template)