Make sure to not log exceptions if Swift deletes fail

This commit is contained in:
Joseph Schorr 2016-11-10 11:57:44 -05:00
parent 10255d4052
commit 59cb6bd216
2 changed files with 5 additions and 1 deletions

View file

@ -206,7 +206,6 @@ class SwiftStorage(BaseStorage):
try:
self._get_connection().delete_object(self._swift_container, path)
except Exception:
logger.exception('Could not delete path %s', path)
raise IOError('Cannot delete path: %s' % path)
def _random_checksum(self, count):

View file

@ -39,6 +39,11 @@ class MockSwiftTests(unittest.TestCase):
swift.exists('object/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):
def __init__(self, *args, **kwargs):