summaryrefslogtreecommitdiffstats
path: root/install
diff options
context:
space:
mode:
authorPetr Viktorin <pviktori@redhat.com>2012-07-18 06:47:07 -0400
committerRob Crittenden <rcritten@redhat.com>2012-07-18 23:15:34 -0400
commite578183ea25a40aedf6dcc3e1ee4bcb19b73e70f (patch)
tree0c5667ec4bcc6ac392a12354de2ede1ac7c0e42a /install
parent429edcfb72674d113edddddc448e80a390210311 (diff)
downloadfreeipa-e578183ea25a40aedf6dcc3e1ee4bcb19b73e70f.tar.gz
freeipa-e578183ea25a40aedf6dcc3e1ee4bcb19b73e70f.tar.xz
freeipa-e578183ea25a40aedf6dcc3e1ee4bcb19b73e70f.zip
Fix updating minimum_connections in ipa-upgradeconfig
The upgrade script set the "psearch" directive in some circumstances, but did not remember that it was set, so later, when setting minimum_connections, it assumed psearch is not set. Also, the script did not set minimum_connections if the directive wasn't already there. It should be set in that case. Related to https://fedorahosted.org/freeipa/ticket/2554
Diffstat (limited to 'install')
-rw-r--r--install/tools/ipa-upgradeconfig37
1 files changed, 19 insertions, 18 deletions
diff --git a/install/tools/ipa-upgradeconfig b/install/tools/ipa-upgradeconfig
index b82f039d4..cfb9a19e3 100644
--- a/install/tools/ipa-upgradeconfig
+++ b/install/tools/ipa-upgradeconfig
@@ -339,6 +339,7 @@ def named_enable_psearch():
bindinstance.NAMED_CONF, e)
else:
changed = True
+ psearch = "yes"
sysupgrade.set_upgrade_state('named.conf', 'psearch_enabled', True)
root_logger.debug('Persistent search enabled')
@@ -353,24 +354,24 @@ def named_enable_psearch():
root_logger.debug('Cannot retrieve connections option from %s: %s',
bindinstance.NAMED_CONF, e)
return
- if connections is not None:
- try:
+ try:
+ if connections is not None:
connections = int(connections)
- except ValueError:
- # this should not happend, but there is some bad value in
- # "connections" option, bail out
- pass
- else:
- if connections < minimum_connections:
- try:
- bindinstance.named_conf_set_directive('connections',
- minimum_connections)
- root_logger.debug('Connections set to %d', minimum_connections)
- except IOError, e:
- root_logger.error('Cannot update connections in %s: %s',
- bindinstance.NAMED_CONF, e)
- else:
- changed = True
+ except ValueError:
+ # this should not happend, but there is some bad value in
+ # "connections" option, bail out
+ pass
+ else:
+ if connections is None or connections < minimum_connections:
+ try:
+ bindinstance.named_conf_set_directive('connections',
+ minimum_connections)
+ root_logger.debug('Connections set to %d', minimum_connections)
+ except IOError, e:
+ root_logger.error('Cannot update connections in %s: %s',
+ bindinstance.NAMED_CONF, e)
+ else:
+ changed = True
if not changed:
root_logger.debug('No changes made')
@@ -408,7 +409,7 @@ def named_enable_serial_autoincrement():
# enable SOA serial autoincrement
if not sysupgrade.get_upgrade_state('named.conf', 'autoincrement_enabled'):
if psearch != "yes": # psearch is required
- root_logger.debug('Persistent search is disabled, '
+ root_logger.error('Persistent search is disabled, '
'serial autoincrement cannot be enabled')
else:
if serial_autoincrement != 'yes':