Merge "Adding filesystem schema check in async task" into stable/juno
This commit is contained in:
commit
cd42a98b61
|
@ -92,10 +92,10 @@ def validate_location_uri(location):
|
|||
return location
|
||||
|
||||
# NOTE: file type uri is being avoided for security reasons,
|
||||
# see LP bug #942118.
|
||||
elif location.startswith("file:///"):
|
||||
msg = ("File based imports are not allowed. Please use a non-local "
|
||||
"source of image data.")
|
||||
# see LP bug #942118 #1400966.
|
||||
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)
|
||||
|
|
|
@ -76,6 +76,8 @@ class TestScriptsUtils(test_utils.BaseTestCase):
|
|||
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,
|
||||
"filesystem:///tmp")
|
||||
|
||||
def test_validate_location_unsupported_error(self):
|
||||
location = 'swift'
|
||||
|
|
Loading…
Reference in New Issue