Make sure to not log exceptions if Swift deletes fail
This commit is contained in:
parent
10255d4052
commit
59cb6bd216
2 changed files with 5 additions and 1 deletions
|
@ -206,7 +206,6 @@ class SwiftStorage(BaseStorage):
|
||||||
try:
|
try:
|
||||||
self._get_connection().delete_object(self._swift_container, path)
|
self._get_connection().delete_object(self._swift_container, path)
|
||||||
except Exception:
|
except Exception:
|
||||||
logger.exception('Could not delete path %s', path)
|
|
||||||
raise IOError('Cannot delete path: %s' % path)
|
raise IOError('Cannot delete path: %s' % path)
|
||||||
|
|
||||||
def _random_checksum(self, count):
|
def _random_checksum(self, count):
|
||||||
|
|
|
@ -39,6 +39,11 @@ class MockSwiftTests(unittest.TestCase):
|
||||||
swift.exists('object/path')
|
swift.exists('object/path')
|
||||||
swift._get_connection().head_object.assert_called_with('container-name', 'basepathobject/path')
|
swift._get_connection().head_object.assert_called_with('container-name', 'basepathobject/path')
|
||||||
|
|
||||||
|
def test_delete_unknown_path(self):
|
||||||
|
swift = SwiftStorage(**self.base_args)
|
||||||
|
with self.assertRaises(IOError):
|
||||||
|
swift.remove('someunknownpath')
|
||||||
|
|
||||||
|
|
||||||
class FakeSwiftStorage(SwiftStorage):
|
class FakeSwiftStorage(SwiftStorage):
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
|
|
Reference in a new issue