Merge "Port script utils to Python 3"
This commit is contained in:
commit
047773ccde
@ -97,9 +97,9 @@ def validate_location_uri(location):
|
||||
elif location.startswith(("file:///", "filesystem:///")):
|
||||
msg = _("File based imports are not allowed. Please use a non-local "
|
||||
"source of image data.")
|
||||
# NOTE: raise Exception and let the encompassing block save
|
||||
# the error msg in the task.message.
|
||||
raise StandardError(msg)
|
||||
# NOTE: raise BadStoreUri and let the encompassing block save the error
|
||||
# msg in the task.message.
|
||||
raise exception.BadStoreUri(msg)
|
||||
|
||||
else:
|
||||
# TODO(nikhil): add other supported uris
|
||||
|
@ -89,9 +89,10 @@ class TestScriptsUtils(test_utils.BaseTestCase):
|
||||
script_utils.validate_location_uri, '')
|
||||
|
||||
def test_validate_location_file_location_error(self):
|
||||
self.assertRaises(StandardError, script_utils.validate_location_uri,
|
||||
"file:///tmp")
|
||||
self.assertRaises(StandardError, script_utils.validate_location_uri,
|
||||
self.assertRaises(exception.BadStoreUri,
|
||||
script_utils.validate_location_uri, "file:///tmp")
|
||||
self.assertRaises(exception.BadStoreUri,
|
||||
script_utils.validate_location_uri,
|
||||
"filesystem:///tmp")
|
||||
|
||||
def test_validate_location_unsupported_error(self):
|
||||
|
2
tox.ini
2
tox.ini
@ -28,6 +28,8 @@ commands =
|
||||
glance.tests.unit.async.flows.test_introspect \
|
||||
glance.tests.unit.async.test_async \
|
||||
glance.tests.unit.async.test_taskflow_executor \
|
||||
glance.tests.unit.common.scripts.image_import.test_main \
|
||||
glance.tests.unit.common.scripts.test_scripts_utils \
|
||||
glance.tests.unit.common.test_client \
|
||||
glance.tests.unit.common.test_config \
|
||||
glance.tests.unit.common.test_exception \
|
||||
|
Loading…
x
Reference in New Issue
Block a user