Merge "Py3: Fix two unbound variables"

This commit is contained in:
Zuul 2018-12-18 01:34:46 +00:00 committed by Gerrit Code Review
commit 7f8e1f8ff4
2 changed files with 4 additions and 4 deletions

View File

@ -1527,10 +1527,11 @@ class ContainerSharder(ContainerReplicator):
self._increment_stat('visited', 'success', statsd=True)
else:
self._increment_stat('visited', 'skipped')
except (Exception, Timeout) as error:
except (Exception, Timeout) as err:
self._increment_stat('visited', 'failure', statsd=True)
self.logger.exception(
'Unhandled exception while processing %s: %s', path, error)
'Unhandled exception while processing %s: %s', path, err)
error = err
try:
self._record_sharding_progress(broker, node, error)
except (Exception, Timeout) as error:

View File

@ -744,10 +744,9 @@ class TestObjectExpirer(TestCase):
x.run_once = raise_exceptions
x.run_forever()
except SystemExit as err:
pass
self.assertEqual(str(err), 'exiting exception 2')
finally:
expirer.sleep = orig_sleep
self.assertEqual(str(err), 'exiting exception 2')
self.assertEqual(x.logger.get_lines_for_level('error'),
['Unhandled exception: '])
log_args, log_kwargs = x.logger.log_dict['error'][0]