diff options
author | Stuart McLaren <stuart.mclaren@hp.com> | 2014-10-07 13:33:15 +0000 |
---|---|---|
committer | Stuart McLaren <stuart.mclaren@hp.com> | 2014-10-07 13:39:12 +0000 |
commit | c86cbd85752479d24e4df8f4af4b06c86bb35844 (patch) | |
tree | 7032997a25e13e65708399db8070f92efc8b30fe | |
parent | e9e127190011f6c2daaccfdb97b2e034b88f2680 (diff) | |
download | glance_store-c86cbd85752479d24e4df8f4af4b06c86bb35844.tar.gz |
Remove validate_location
As part of the fix for bug 1334196 Glance no longer uses the
'validate_location' function. (https://review.openstack.org/#/c/107383/)
It can be removed from the store.
Change-Id: Ib45f2d5d04bf28b8dfe9c5e879f910514f330950
-rw-r--r-- | glance_store/_drivers/swift/store.py | 6 | ||||
-rw-r--r-- | glance_store/backend.py | 5 | ||||
-rw-r--r-- | glance_store/driver.py | 7 | ||||
-rw-r--r-- | tests/unit/test_swift_store.py | 21 |
4 files changed, 0 insertions, 39 deletions
diff --git a/glance_store/_drivers/swift/store.py b/glance_store/_drivers/swift/store.py index 885368c..2040982 100644 --- a/glance_store/_drivers/swift/store.py +++ b/glance_store/_drivers/swift/store.py @@ -398,12 +398,6 @@ class BaseStore(driver.Store): return (resp_headers, resp_body) - def validate_location(self, uri): - pieces = urlparse.urlparse(uri) - if pieces.scheme in ['swift+config']: - reason = (_("Location credentials are invalid")) - raise exceptions.BadStoreUri(message=reason) - def get(self, location, connection=None, offset=0, chunk_size=None, context=None): location = location.store_location diff --git a/glance_store/backend.py b/glance_store/backend.py index e300de7..3c8a23b 100644 --- a/glance_store/backend.py +++ b/glance_store/backend.py @@ -371,8 +371,3 @@ def set_acls(location_uri, public=False, read_tenants=[], write_tenants=write_tenants) except NotImplementedError: LOG.debug(_("Skipping store.set_acls... not implemented.")) - - -def validate_location(uri, context=None): - store = get_store_from_uri(uri) - store.validate_location(uri) diff --git a/glance_store/driver.py b/glance_store/driver.py index 0bdf36e..d1d28f8 100644 --- a/glance_store/driver.py +++ b/glance_store/driver.py @@ -96,13 +96,6 @@ class Store(object): """ # NOTE(flaper87): This should probably go away - def validate_location(self, location): - """ - Takes a location and validates it for the presence - of any account references - """ - pass - def get(self, location, offset=0, chunk_size=None, context=None): """ Takes a `glance_store.location.Location` object that indicates diff --git a/tests/unit/test_swift_store.py b/tests/unit/test_swift_store.py index e7b956b..5ebbcef 100644 --- a/tests/unit/test_swift_store.py +++ b/tests/unit/test_swift_store.py @@ -240,27 +240,6 @@ class SwiftTests(object): image_size = self.store.get_size(loc) self.assertEqual(image_size, 5120) - def test_validate_location_for_invalid_uri(self): - """ - Test that validate location raises when the location contains - any account reference. - """ - uri = "swift+config://store_1/glance/%s" - self.assertRaises(exceptions.BadStoreUri, - self.store.validate_location, - uri) - - def test_validate_location_for_valid_uri(self): - """ - Test that validate location verifies that the location does not - contain any account reference - """ - uri = "swift://user:key@auth_address/glance/%s" - try: - self.assertIsNone(self.store.validate_location(uri)) - except Exception: - self.fail('Location uri validation failed') - def test_get_size_with_multi_tenant_on(self): """Test that single tenant uris work with multi tenant on.""" uri = ("swift://%s:key@auth_address/glance/%s" % |