Yaniv Dary has uploaded a new change for review. Change subject: packaging: setup: Ask only during setup ......................................................................
packaging: setup: Ask only during setup Move customization question 'Configure Reports on this host' from common to setup so that it's not asked during cleanup (or rename). Change-Id: I2360968a46a660c0634a25ef1d91fb1f2da92ce8 Bug-Url: https://bugzilla.redhat.com/1080431 Signed-off-by: Yedidyah Bar David <d...@redhat.com> (cherry picked from commit 8cf433e829e8b919d49a520aaf1f73d3bd50519f) --- M packaging/setup/plugins/ovirt-engine-common/ovirt-engine-reports/core/misc.py A packaging/setup/plugins/ovirt-engine-setup/ovirt-engine-reports/core/__init__.py A packaging/setup/plugins/ovirt-engine-setup/ovirt-engine-reports/core/misc.py 3 files changed, 97 insertions(+), 26 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-reports refs/changes/04/27204/1 diff --git a/packaging/setup/plugins/ovirt-engine-common/ovirt-engine-reports/core/misc.py b/packaging/setup/plugins/ovirt-engine-common/ovirt-engine-reports/core/misc.py index 06d2773..ced9a64 100644 --- a/packaging/setup/plugins/ovirt-engine-common/ovirt-engine-reports/core/misc.py +++ b/packaging/setup/plugins/ovirt-engine-common/ovirt-engine-reports/core/misc.py @@ -26,7 +26,6 @@ from ovirt_engine_setup import constants as osetupcons from ovirt_engine_setup import reportsconstants as oreportscons -from ovirt_engine_setup import dialog @util.export @@ -62,30 +61,5 @@ oreportscons.Const.DISPLAY_VERSION, ) - @plugin.event( - stage=plugin.Stages.STAGE_CUSTOMIZATION, - name=oreportscons.Stages.CORE_ENABLE, - before=( - osetupcons.Stages.DIALOG_TITLES_E_PRODUCT_OPTIONS, - oreportscons.Stages.DB_CONNECTION_CUSTOMIZATION, - ), - after=( - osetupcons.Stages.DIALOG_TITLES_S_PRODUCT_OPTIONS, - ), - ) - def _customization(self): - if self.environment[oreportscons.CoreEnv.ENABLE] is None: - self.environment[ - oreportscons.CoreEnv.ENABLE - ] = dialog.queryBoolean( - dialog=self.dialog, - name='OVESETUP_REPORTS_ENABLE', - note=_( - 'Configure Reports on this host ' - '(@VALUES@) [@DEFAULT@]: ' - ), - prompt=True, - default=True, - ) # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/packaging/setup/plugins/ovirt-engine-setup/ovirt-engine-reports/core/__init__.py b/packaging/setup/plugins/ovirt-engine-setup/ovirt-engine-reports/core/__init__.py new file mode 100644 index 0000000..8a2b0f8 --- /dev/null +++ b/packaging/setup/plugins/ovirt-engine-setup/ovirt-engine-reports/core/__init__.py @@ -0,0 +1,33 @@ +# +# ovirt-engine-setup -- ovirt engine setup +# Copyright (C) 2014 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. +# + + +"""Reports setup core plugin.""" + + +from otopi import util + + +from . import misc + + +@util.export +def createPlugins(context): + misc.Plugin(context=context) + + +# vim: expandtab tabstop=4 shiftwidth=4 diff --git a/packaging/setup/plugins/ovirt-engine-setup/ovirt-engine-reports/core/misc.py b/packaging/setup/plugins/ovirt-engine-setup/ovirt-engine-reports/core/misc.py new file mode 100644 index 0000000..c1ee7c1 --- /dev/null +++ b/packaging/setup/plugins/ovirt-engine-setup/ovirt-engine-reports/core/misc.py @@ -0,0 +1,64 @@ +# +# ovirt-engine-setup -- ovirt engine setup +# Copyright (C) 2014 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. +# + + +import gettext +_ = lambda m: gettext.dgettext(message=m, domain='ovirt-engine-reports') + + +from otopi import util +from otopi import plugin + + +from ovirt_engine_setup import constants as osetupcons +from ovirt_engine_setup import reportsconstants as oreportscons +from ovirt_engine_setup import dialog + + +@util.export +class Plugin(plugin.PluginBase): + + def __init__(self, context): + super(Plugin, self).__init__(context=context) + + @plugin.event( + stage=plugin.Stages.STAGE_CUSTOMIZATION, + name=oreportscons.Stages.CORE_ENABLE, + before=( + osetupcons.Stages.DIALOG_TITLES_E_PRODUCT_OPTIONS, + oreportscons.Stages.DB_CONNECTION_CUSTOMIZATION, + ), + after=( + osetupcons.Stages.DIALOG_TITLES_S_PRODUCT_OPTIONS, + ), + ) + def _customization(self): + if self.environment[oreportscons.CoreEnv.ENABLE] is None: + self.environment[ + oreportscons.CoreEnv.ENABLE + ] = dialog.queryBoolean( + dialog=self.dialog, + name='OVESETUP_REPORTS_ENABLE', + note=_( + 'Configure Reports on this host ' + '(@VALUES@) [@DEFAULT@]: ' + ), + prompt=True, + default=True, + ) + +# vim: expandtab tabstop=4 shiftwidth=4 -- To view, visit http://gerrit.ovirt.org/27204 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2360968a46a660c0634a25ef1d91fb1f2da92ce8 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-reports Gerrit-Branch: ovirt-engine-3.4 Gerrit-Owner: Yaniv Dary <yd...@redhat.com> Gerrit-Reviewer: Yedidyah Bar David <d...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches