Add more debug logging to download detached volume test Signed-off-by: Prasanna Santhanam <t...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/3455a762 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/3455a762 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/3455a762 Branch: refs/heads/4.2 Commit: 3455a76237481c3bbb590e88d37b6ca351c113fc Parents: 99329df Author: Prasanna Santhanam <t...@apache.org> Authored: Sat Aug 10 16:18:29 2013 +0530 Committer: Prasanna Santhanam <t...@apache.org> Committed: Sat Aug 10 16:18:29 2013 +0530 ---------------------------------------------------------------------- test/integration/smoke/test_volumes.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3455a762/test/integration/smoke/test_volumes.py ---------------------------------------------------------------------- diff --git a/test/integration/smoke/test_volumes.py b/test/integration/smoke/test_volumes.py index dd3d8a4..b60b70e 100644 --- a/test/integration/smoke/test_volumes.py +++ b/test/integration/smoke/test_volumes.py @@ -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)" \