mirror of https://github.com/apache/cloudstack.git
Add more debug logging to download detached volume test
Signed-off-by: Prasanna Santhanam <tsp@apache.org>
This commit is contained in:
parent
99329dfa4a
commit
3455a76237
|
|
@ -521,13 +521,15 @@ class TestVolumes(cloudstackTestCase):
|
|||
#Attempt to download the volume and save contents locally
|
||||
try:
|
||||
formatted_url = urllib.unquote_plus(extract_vol.url)
|
||||
self.debug("Attempting to download volume at url %s" % formatted_url)
|
||||
response = urllib.urlopen(formatted_url)
|
||||
self.debug("response from volume url %s" % response.getcode())
|
||||
fd, path = tempfile.mkstemp()
|
||||
self.debug("Saving volume %s to path %s" %(self.volume.id, path))
|
||||
os.close(fd)
|
||||
fd = open(path, 'wb')
|
||||
fd.write(response.read())
|
||||
fd.close()
|
||||
|
||||
with open(path, 'wb') as fd:
|
||||
fd.write(response.read())
|
||||
self.debug("Saved volume successfully")
|
||||
except Exception:
|
||||
self.fail(
|
||||
"Extract Volume Failed with invalid URL %s (vol id: %s)" \
|
||||
|
|
|
|||
Loading…
Reference in New Issue