Commit 37035a07 authored by Michal 'vorner' Vaner's avatar Michal 'vorner' Vaner
Browse files

[trac945] Accept even 0 as a value

parent b5dc1d86
......@@ -417,19 +417,33 @@ class ZonemgrRefresh:
# store the values so we can restore them if there is a problem
lowerbound_refresh_backup = self._lowerbound_refresh
self._lowerbound_refresh = new_config.get('lowerbound_refresh') or self._lowerbound_refresh
# Get a new value, but only if it is defined
# We don't use "value or default", because if value would be
# 0, we would take default
def val_or_default(value, default):
if value is not None:
return value
else:
return default
self._lowerbound_refresh = val_or_default(
new_config.get('lowerbound_refresh'), self._lowerbound_refresh)
lowerbound_retry_backup = self._lowerbound_retry
self._lowerbound_retry = new_config.get('lowerbound_retry') or self._lowerbound_retry
self._lowerbound_retry = val_or_default(
new_config.get('lowerbound_retry'), self._lowerbound_retry)
max_transfer_timeout_backup = self._max_transfer_timeout
self._max_transfer_timeout = new_config.get('max_transfer_timeout') or self._max_transfer_timeout
self._max_transfer_timeout = val_or_default(
new_config.get('max_transfer_timeout'), self._max_transfer_timeout)
refresh_jitter_backup = self._refresh_jitter
self._refresh_jitter = new_config.get('refresh_jitter') or self._refresh_jitter
self._refresh_jitter = val_or_default(
new_config.get('refresh_jitter'), self._refresh_jitter)
reload_jitter_backup = self._reload_jitter
self._reload_jitter = new_config.get('reload_jitter') or self._reload_jitter
self._reload_jitter = val_or_default(
new_config.get('reload_jitter'), self._reload_jitter)
try:
required = {}
secondary_zones = new_config.get('secondary_zones')
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment