Merge "Adding filesystem schema check in async task"

This commit is contained in:
Jenkins 2015-01-23 18:46:05 +00:00 committed by Gerrit Code Review
commit 808fa29ce2
2 changed files with 4 additions and 2 deletions

View File

@ -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

View File

@ -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'