summaryrefslogtreecommitdiff
diff options
authorJeff Lane <jeffrey.lane@canonical.com>2016-12-22 15:36:06 -0500
committerJeff Lane <jeffrey.lane@canonical.com>2016-12-22 15:36:06 -0500
commit27c2172ea20243a25eebcfcacec3a5a481a04d63 (patch)
tree64945a8a116e89c15882f461908888056a06fada
parent6b8879b61521a7c75d8e69ac4cdf4cb2fa9aa56e (diff)
Removed unnecessary return statements. Fixed syntax error in an if/else statement.
-rwxr-xr-xbin/virtualization19
1 files changed, 8 insertions, 11 deletions
diff --git a/bin/virtualization b/bin/virtualization
index 1867143..748c60c 100755
--- a/bin/virtualization
+++ b/bin/virtualization
@@ -273,14 +273,13 @@ class KVMTest(object):
"finding the expected file. Check the URL "
"noted above.")
sys.exit(1)
- else:
- return full_url
- else:
- return full_url
else:
url = urlparse(image_url)
- if url.path.endswith('/') or url.path == '' or
- not url.path.endswith(".img"):
+ if (
+ url.path.endswith('/') or
+ url.path == '' or
+ not url.path.endswith(".img")
+ ):
# If we have a relative URL (local copies of official images)
# http://192.168.0.1/ or http://192.168.0.1/images/
cloud_iso = _construct_filename()
@@ -299,10 +298,6 @@ class KVMTest(object):
"finding the expected file. Check the "
"URL noted above.")
sys.exit(1)
- else:
- return full_url
- else:
- return full_url
else:
# Assume anything else is an absolute URL to a remote server
if not _test_cloud_url(image_url):
@@ -310,7 +305,9 @@ class KVMTest(object):
logging.error(" * Check the URL and ensure it is correct")
sys.exit(1)
else:
- return image_url
+ full_url = image_url
+
+ return full_url
def download_image(self, image_url=None):
"""