Merge "Adding filesystem schema check in async task"
This commit is contained in:
commit
808fa29ce2
@ -93,8 +93,8 @@ 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:///"):
|
||||
# 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
|
||||
|
@ -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…
x
Reference in New Issue
Block a user