Continue logging deprecation warnings for run_pause

...even after the operator has configured interval. This was raised
during the Oct 2020 ops feedback session.

Change-Id: Ie44de8f15df63813367b76e1b96be456fac9b2b0
This commit is contained in:
Tim Burke 2020-11-04 15:56:00 -08:00 committed by Tim Burke
parent c75e23e81f
commit 2b1eec79f6
3 changed files with 40 additions and 19 deletions

View File

@ -198,13 +198,21 @@ class Replicator(Daemon):
self.max_diffs = int(conf.get('max_diffs') or 100)
self.interval = int(conf.get('interval') or
conf.get('run_pause') or 30)
if 'run_pause' in conf and 'interval' not in conf:
self.logger.warning('Option %(type)s-replicator/run_pause '
'is deprecated and will be removed in a '
'future version. Update your configuration'
' to use option %(type)s-replicator/'
'interval.'
% {'type': self.server_type})
if 'run_pause' in conf:
if 'interval' in conf:
self.logger.warning(
'Option %(type)s-replicator/run_pause is deprecated '
'and %(type)s-replicator/interval is already configured. '
'You can safely remove run_pause; it is now ignored and '
'will be removed in a future version.'
% {'type': self.server_type})
else:
self.logger.warning(
'Option %(type)s-replicator/run_pause is deprecated '
'and will be removed in a future version. '
'Update your configuration to use option '
'%(type)s-replicator/interval.'
% {'type': self.server_type})
self.databases_per_second = float(
conf.get('databases_per_second', 50))
self.node_timeout = float(conf.get('node_timeout', 10))

View File

@ -168,12 +168,19 @@ class ObjectReconstructor(Daemon):
self.partition_times = []
self.interval = int(conf.get('interval') or
conf.get('run_pause') or 30)
if 'run_pause' in conf and 'interval' not in conf:
self.logger.warning('Option object-reconstructor/run_pause '
'is deprecated and will be removed in a '
'future version. Update your configuration'
' to use option object-reconstructor/'
'interval.')
if 'run_pause' in conf:
if 'interval' in conf:
self.logger.warning(
'Option object-reconstructor/run_pause is deprecated and '
'object-reconstructor/interval is already configured. '
'You can safely remove run_pause; it is now ignored and '
'will be removed in a future version.')
else:
self.logger.warning(
'Option object-reconstructor/run_pause is deprecated '
'and will be removed in a future version. '
'Update your configuration to use option '
'object-reconstructor/interval.')
self.http_timeout = int(conf.get('http_timeout', 60))
self.lockup_timeout = int(conf.get('lockup_timeout', 1800))
self.recon_cache_path = conf.get('recon_cache_path',

View File

@ -148,12 +148,18 @@ class ObjectReplicator(Daemon):
self.partition_times = []
self.interval = int(conf.get('interval') or
conf.get('run_pause') or 30)
if 'run_pause' in conf and 'interval' not in conf:
self.logger.warning('Option object-replicator/run_pause '
'is deprecated and will be removed in a '
'future version. Update your configuration'
' to use option object-replicator/'
'interval.')
if 'run_pause' in conf:
if 'interval' in conf:
self.logger.warning(
'Option object-replicator/run_pause is deprecated and '
'object-replicator/interval is already configured. You '
'can safely remove run_pause; it is now ignored and will '
'be removed in a future version.')
else:
self.logger.warning(
'Option object-replicator/run_pause is deprecated and '
'will be removed in a future version. Update your '
'configuration to use option object-replicator/interval.')
self.rsync_timeout = int(conf.get('rsync_timeout',
DEFAULT_RSYNC_TIMEOUT))
self.rsync_io_timeout = conf.get('rsync_io_timeout', '30')