diff options
author | Endi S. Dewata <edewata@redhat.com> | 2017-06-01 04:54:05 +0200 |
---|---|---|
committer | Endi S. Dewata <edewata@redhat.com> | 2017-06-02 17:31:04 +0200 |
commit | b3d851b864dc986a9af8ffcb1962f8e7b4de3114 (patch) | |
tree | 16c49db28d5650e230141f2eb70ab3143085f94f /base/server/upgrade | |
parent | f7b6305396581f5916498cc4ea8247596bf39aaf (diff) | |
download | pki-b3d851b864dc986a9af8ffcb1962f8e7b4de3114.tar.gz pki-b3d851b864dc986a9af8ffcb1962f8e7b4de3114.tar.xz pki-b3d851b864dc986a9af8ffcb1962f8e7b4de3114.zip |
Added upgrade script for keepAliveTimeout.
An upgrade script has been added to set the keepAliveTimeout
attribute for the Secure connector in the server.xml.
https://pagure.io/dogtagpki/issue/2687
Change-Id: Ia61ed49d0ffc26d4bb44738c71fc663bde37fb1d
Diffstat (limited to 'base/server/upgrade')
-rw-r--r-- | base/server/upgrade/10.4.3/.gitignore | 4 | ||||
-rw-r--r-- | base/server/upgrade/10.4.4/.gitignore | 4 | ||||
-rw-r--r-- | base/server/upgrade/10.4.5/.gitignore | 4 | ||||
-rwxr-xr-x | base/server/upgrade/10.4.6/01-UpdateKeepAliveTimeout | 59 |
4 files changed, 71 insertions, 0 deletions
diff --git a/base/server/upgrade/10.4.3/.gitignore b/base/server/upgrade/10.4.3/.gitignore new file mode 100644 index 000000000..5e7d2734c --- /dev/null +++ b/base/server/upgrade/10.4.3/.gitignore @@ -0,0 +1,4 @@ +# Ignore everything in this directory +* +# Except this file +!.gitignore diff --git a/base/server/upgrade/10.4.4/.gitignore b/base/server/upgrade/10.4.4/.gitignore new file mode 100644 index 000000000..5e7d2734c --- /dev/null +++ b/base/server/upgrade/10.4.4/.gitignore @@ -0,0 +1,4 @@ +# Ignore everything in this directory +* +# Except this file +!.gitignore diff --git a/base/server/upgrade/10.4.5/.gitignore b/base/server/upgrade/10.4.5/.gitignore new file mode 100644 index 000000000..5e7d2734c --- /dev/null +++ b/base/server/upgrade/10.4.5/.gitignore @@ -0,0 +1,4 @@ +# Ignore everything in this directory +* +# Except this file +!.gitignore diff --git a/base/server/upgrade/10.4.6/01-UpdateKeepAliveTimeout b/base/server/upgrade/10.4.6/01-UpdateKeepAliveTimeout new file mode 100755 index 000000000..31c4d1b93 --- /dev/null +++ b/base/server/upgrade/10.4.6/01-UpdateKeepAliveTimeout @@ -0,0 +1,59 @@ +#!/usr/bin/python +# Authors: +# Endi S. Dewata <edewata@redhat.com> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Copyright (C) 2017 Red Hat, Inc. +# All rights reserved. +# + +from __future__ import absolute_import +import os +from lxml import etree + +import pki + + +class UpdateKeepAliveTimeout( + pki.server.upgrade.PKIServerUpgradeScriptlet): + + def __init__(self): + super(UpdateKeepAliveTimeout, self).__init__() + self.message = 'Update keepAliveTimeout parameter' + + self.parser = etree.XMLParser(remove_blank_text=True) + + def upgrade_instance(self, instance): + + server_xml = os.path.join(instance.conf_dir, 'server.xml') + self.backup(server_xml) + + document = etree.parse(server_xml, self.parser) + + server = document.getroot() + connectors = server.findall('.//Connector') + + for connector in connectors: + + # find the Secure connector + name = connector.get('name') + if name != 'Secure': + continue + + # set the keepAliveTimeout parameter to 5 minutes + connector.set('keepAliveTimeout', '300000') + + with open(server_xml, 'wb') as f: + document.write(f, pretty_print=True, encoding='utf-8') |