Yedidyah Bar David has uploaded a new change for review. Change subject: packaging: setup: Remove log-setup-event ......................................................................
packaging: setup: Remove log-setup-event Remove the script ovirt-engine-log-setup-event.sh, which adds info about setup/upgrade/etc start/stop events to /var/lib/ovirt-engine/setup-history.txt . Existing log files should be enough to get this info. It needlessly slowed down engine-setup and related tools. Change-Id: I5305f63f0d493ca394518498f56c2ae9f265f185 Signed-off-by: Yedidyah Bar David <d...@redhat.com> --- M .gitignore M Makefile M ovirt-engine.spec.in D packaging/bin/ovirt-engine-log-setup-event.sh.in M packaging/setup/ovirt_engine_setup/constants.py D packaging/setup/plugins/ovirt-engine-common/base/distro-rpm/__init__.py D packaging/setup/plugins/ovirt-engine-common/base/distro-rpm/log_setup_event.py 7 files changed, 0 insertions(+), 222 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/01/42401/1 diff --git a/.gitignore b/.gitignore index 3125abf..677ab09 100644 --- a/.gitignore +++ b/.gitignore @@ -48,7 +48,6 @@ build/python-check.sh ovirt-engine.spec packaging/bin/engine-prolog.sh -packaging/bin/ovirt-engine-log-setup-event.sh packaging/bin/pki-common.sh packaging/conf/notifier-logging.properties packaging/etc/engine-manage-domains/engine-manage-domains.conf diff --git a/Makefile b/Makefile index 88bcae5..a0686da 100644 --- a/Makefile +++ b/Makefile @@ -179,7 +179,6 @@ ovirt-engine.spec \ build/python-check.sh \ packaging/bin/engine-prolog.sh \ - packaging/bin/ovirt-engine-log-setup-event.sh \ packaging/bin/pki-common.sh \ packaging/conf/notifier-logging.properties \ packaging/etc/engine-manage-domains/engine-manage-domains.conf \ @@ -231,7 +230,6 @@ chmod a+x packaging/services/ovirt-engine-notifier/ovirt-engine-notifier.sysv chmod a+x packaging/services/ovirt-fence-kdump-listener/ovirt-fence-kdump-listener.sysv chmod a+x packaging/services/ovirt-websocket-proxy/ovirt-websocket-proxy.sysv - chmod a+x packaging/bin/ovirt-engine-log-setup-event.sh # support force run of maven maven: diff --git a/ovirt-engine.spec.in b/ovirt-engine.spec.in index c22cfc3..bee3a6d 100644 --- a/ovirt-engine.spec.in +++ b/ovirt-engine.spec.in @@ -1077,7 +1077,6 @@ %{_mandir}/man8/engine-cleanup.* %{_mandir}/man8/engine-setup.* %{_mandir}/man8/engine-upgrade-check.* -%{engine_data}/bin/ovirt-engine-log-setup-event.sh %{engine_data}/conf/iptables.default.in %{engine_data}/setup/bin/ovirt-engine-remove %{engine_data}/setup/bin/ovirt-engine-rename diff --git a/packaging/bin/ovirt-engine-log-setup-event.sh.in b/packaging/bin/ovirt-engine-log-setup-event.sh.in deleted file mode 100644 index 0195110..0000000 --- a/packaging/bin/ovirt-engine-log-setup-event.sh.in +++ /dev/null @@ -1,92 +0,0 @@ -#!/bin/sh -# ovirt-engine-log-setup-event.sh - log an event during setup/upgrade/cleanup -# -# It logs to a file which should not rotate and allow getting a clear view of -# the entire line of versions installed/upgraded/cleaned/etc. -# -# Copyright (C) 2013 Red Hat, Inc. -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License, or (at your option) any later version. -# -# This library 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 -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -# - -usage() { - cat << __EOF__ -Usage: $0 - --notes=NOTES - Add NOTES to the log - -__EOF__ -} - -notes="" - -while [ -n "$1" ]; do - x="$1" - v="${x#*=}" - shift - case "${x}" in - --notes=*) - notes="${v}" - ;; - --help) - usage - exit 0 - ;; - *) - echo "Invalid option '${x}'" - usage - exit 1 - ;; - esac -done - -get_distro_name() { - python -c 'import platform; print (platform.linux_distribution(full_distribution_name=0)[0])' -} - -get_distro_packages() { - local distro="$(get_distro_name)" - - case "${distro}" in - redhat|centos|fedora|SuSE) - LC_ALL=C rpm -qa --last - ;; - debian|ubuntu) - dpkg -l | awk '/^ii/ {print $2, $3}' - ;; - *) - echo "$0: distribution ${distro} not supported" - ;; - esac -} - -prefix_cmd(){ - local prefix="$1" - shift - "$@" 2>&1 | sed "s/^/${prefix}: /" -} - -( - echo SETUP-EVENT-BEGIN - prefix_cmd DATE date +'%Y-%m-%d %H:%M:%S' - prefix_cmd NOTES echo "${notes}" - prefix_cmd ENGINE_CFG engine-config -g ProductRPMVersion - prefix_cmd ENGINE_CFG engine-config -g VdcVersion - prefix_cmd JBOSS_VER jboss-cli --version - prefix_cmd VIRSH_VER virsh --version - prefix_cmd UNAME_A uname -a - prefix_cmd PACKAGE get_distro_packages | sort - echo SETUP-EVENT-END -) >> @ENGINE_VAR@/setup-history.txt diff --git a/packaging/setup/ovirt_engine_setup/constants.py b/packaging/setup/ovirt_engine_setup/constants.py index 94b9cdd..7859f7f 100644 --- a/packaging/setup/ovirt_engine_setup/constants.py +++ b/packaging/setup/ovirt_engine_setup/constants.py @@ -140,11 +140,6 @@ 'answers', ) - OVIRT_ENGINE_LOG_SETUP_EVENT = os.path.join( - OVIRT_SETUP_BINDIR, - 'ovirt-engine-log-setup-event.sh', - ) - OVIRT_ENGINE_YUM_VERSIONLOCK = os.path.join( SYSCONFDIR, 'yum', diff --git a/packaging/setup/plugins/ovirt-engine-common/base/distro-rpm/__init__.py b/packaging/setup/plugins/ovirt-engine-common/base/distro-rpm/__init__.py deleted file mode 100644 index 835fc27..0000000 --- a/packaging/setup/plugins/ovirt-engine-common/base/distro-rpm/__init__.py +++ /dev/null @@ -1,33 +0,0 @@ -# -# ovirt-engine-setup -- ovirt engine setup -# Copyright (C) 2013 Red Hat, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - - -""" ovirt-host-common distro-rpm plugin. - Includes code relevant for rpm-based distributions -""" - - -from otopi import util -from . import log_setup_event - - -@util.export -def createPlugins(context): - log_setup_event.Plugin(context=context) - - -# vim: expandtab tabstop=4 shiftwidth=4 diff --git a/packaging/setup/plugins/ovirt-engine-common/base/distro-rpm/log_setup_event.py b/packaging/setup/plugins/ovirt-engine-common/base/distro-rpm/log_setup_event.py deleted file mode 100644 index 78654cc..0000000 --- a/packaging/setup/plugins/ovirt-engine-common/base/distro-rpm/log_setup_event.py +++ /dev/null @@ -1,88 +0,0 @@ -# -# ovirt-engine-setup -- ovirt engine setup -# Copyright (C) 2013-2015 Red Hat, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - - -""" -Log setup event plugin -""" - -import gettext -import platform - -from otopi import plugin, util - -from ovirt_engine_setup import constants as osetupcons - - -def _(m): - return gettext.dgettext(message=m, domain='ovirt-engine-setup') - - -@util.export -class Plugin(plugin.PluginBase): - """ - Log setup event plugin - """ - def __init__(self, context): - super(Plugin, self).__init__(context=context) - self._enabled = False - self._distribution = platform.linux_distribution( - full_distribution_name=0 - )[0] - - @plugin.event( - stage=plugin.Stages.STAGE_SETUP, - condition=lambda self: not self.environment[ - osetupcons.CoreEnv.DEVELOPER_MODE - ], - ) - def _setup(self): - if self._distribution in ('redhat', 'fedora', 'centos'): - self._enabled = True - - @plugin.event( - stage=plugin.Stages.STAGE_SETUP, - condition=lambda self: self._enabled, - priority=plugin.Stages.PRIORITY_LAST, - ) - def _log_setup_event_setup(self): - self.execute( - ( - osetupcons.FileLocations.OVIRT_ENGINE_LOG_SETUP_EVENT, - '--notes=Start of %s' % ( - self.environment[osetupcons.CoreEnv.ACTION], - ), - ), - ) - - @plugin.event( - stage=plugin.Stages.STAGE_CLOSEUP, - condition=lambda self: self._enabled, - priority=plugin.Stages.PRIORITY_LAST, - ) - def _log_setup_event_closeup(self): - self.execute( - ( - osetupcons.FileLocations.OVIRT_ENGINE_LOG_SETUP_EVENT, - '--notes=End of %s' % self.environment[ - osetupcons.CoreEnv.ACTION - ], - ), - ) - - -# vim: expandtab tabstop=4 shiftwidth=4 -- To view, visit https://gerrit.ovirt.org/42401 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5305f63f0d493ca394518498f56c2ae9f265f185 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Yedidyah Bar David <d...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches