Alon Bar-Lev has uploaded a new change for review. Change subject: packaging: setup: remove legacy support (3.2) ......................................................................
packaging: setup: remove legacy support (3.2) Remove the legacy handling and abnormality of I876894e7ba that slipped outside of the legacy plugin. Change-Id: I9a798929fb5c831ca46900da6caa1b03a2600555 Signed-off-by: Alon Bar-Lev <[email protected]> --- M packaging/dbscripts/upgrade/pre_upgrade/0000_config.sql M packaging/setup/ovirt_engine_setup/constants.py M packaging/setup/plugins/ovirt-engine-setup/config/__init__.py D packaging/setup/plugins/ovirt-engine-setup/config/productkey_upgrade.py M packaging/setup/plugins/ovirt-engine-setup/core/misc.py D packaging/setup/plugins/ovirt-engine-setup/legacy/__init__.py D packaging/setup/plugins/ovirt-engine-setup/legacy/apache.py D packaging/setup/plugins/ovirt-engine-setup/legacy/ca.py D packaging/setup/plugins/ovirt-engine-setup/legacy/config.py D packaging/setup/plugins/ovirt-engine-setup/legacy/core.py D packaging/setup/plugins/ovirt-engine-setup/legacy/database.py D packaging/setup/plugins/ovirt-engine-setup/legacy/datadomain.py D packaging/setup/plugins/ovirt-engine-setup/legacy/firewall_manager.py D packaging/setup/plugins/ovirt-engine-setup/legacy/firewalld.py D packaging/setup/plugins/ovirt-engine-setup/legacy/isodomain.py 15 files changed, 13 insertions(+), 1,266 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/49/22149/1 diff --git a/packaging/dbscripts/upgrade/pre_upgrade/0000_config.sql b/packaging/dbscripts/upgrade/pre_upgrade/0000_config.sql index 5e88cd4..9d0556e 100644 --- a/packaging/dbscripts/upgrade/pre_upgrade/0000_config.sql +++ b/packaging/dbscripts/upgrade/pre_upgrade/0000_config.sql @@ -418,18 +418,6 @@ select fn_db_add_config_value('PredefinedVMProperties','sap_agent=^(true|false)$;sndbuf=^[0-9]+$;vhost=^(([a-zA-Z0-9_]*):(true|false))(,(([a-zA-Z0-9_]*):(true|false)))*$;viodiskcache=^(none|writeback|writethrough)$','3.1'); select fn_db_add_config_value('PredefinedVMProperties','sap_agent=^(true|false)$;sndbuf=^[0-9]+$;vhost=^(([a-zA-Z0-9_]*):(true|false))(,(([a-zA-Z0-9_]*):(true|false)))*$;viodiskcache=^(none|writeback|writethrough)$','3.2'); select fn_db_add_config_value('PredefinedVMProperties','sap_agent=^(true|false)$;sndbuf=^[0-9]+$;vhost=^(([a-zA-Z0-9_]*):(true|false))(,(([a-zA-Z0-9_]*):(true|false)))*$;viodiskcache=^(none|writeback|writethrough)$','3.3'); -select fn_db_add_config_value('ProductKey2003','','general'); -select fn_db_add_config_value('ProductKey2003x64','','general'); -select fn_db_add_config_value('ProductKey2008','','general'); -select fn_db_add_config_value('ProductKey2008R2','','general'); -select fn_db_add_config_value('ProductKey2008x64','','general'); ---Handling Product Key (for Windows XP) -select fn_db_add_config_value('ProductKey','','general'); -select fn_db_add_config_value('ProductKeyWindow7','','general'); -select fn_db_add_config_value('ProductKeyWindow7x64','','general'); -select fn_db_add_config_value('ProductKeyWindows8','','general'); -select fn_db_add_config_value('ProductKeyWindows8x64','','general'); -select fn_db_add_config_value('ProductKeyWindows2012x64','','general'); select fn_db_add_config_value('ProductRPMVersion','3.0.0.0','general'); select fn_db_add_config_value('QuotaGraceStorage','20','general'); select fn_db_add_config_value('QuotaGraceVdsGroup','20','general'); @@ -837,6 +825,17 @@ select fn_db_delete_config_value('LogVdsRegistration','general'); select fn_db_delete_config_value('LogXmlRpcData','general'); select fn_db_delete_config_value('NetConsolePort','general'); +select fn_db_delete_config_value('ProductKey2003','general'); +select fn_db_delete_config_value('ProductKey2003x64','general'); +select fn_db_delete_config_value('ProductKey2008','general'); +select fn_db_delete_config_value('ProductKey2008R2','general'); +select fn_db_delete_config_value('ProductKey2008x64','general'); +select fn_db_delete_config_value('ProductKey','general'); +select fn_db_delete_config_value('ProductKeyWindow7','general'); +select fn_db_delete_config_value('ProductKeyWindow7x64','general'); +select fn_db_delete_config_value('ProductKeyWindows8','general'); +select fn_db_delete_config_value('ProductKeyWindows8x64','general'); +select fn_db_delete_config_value('ProductKeyWindows2012x64','general'); select fn_db_delete_config_value('VdsFenceOptionMapping','general'); -- removing power client select fn_db_delete_config_value('PowerClientAllowUsingAsIRS','general'); diff --git a/packaging/setup/ovirt_engine_setup/constants.py b/packaging/setup/ovirt_engine_setup/constants.py index f4492b6..63b7eab 100644 --- a/packaging/setup/ovirt_engine_setup/constants.py +++ b/packaging/setup/ovirt_engine_setup/constants.py @@ -78,10 +78,6 @@ OVIRT_ENGINE_WEBSOCKET_PROXY_CONFIG = config.ENGINE_WEBSOCKET_PROXY_CONFIG OVIRT_ENGINE_NOTIFIER_SERVICE_CONFIG = \ config.ENGINE_NOTIFIER_SERVICE_CONFIG - OVIRT_ENGINE_OSINFO_REPOSITORY_DIR = os.path.join( - OVIRT_ENGINE_SYSCONFDIR, - 'osinfo.conf.d', - ) OVIRT_ENGINE_BINDIR = os.path.join( OVIRT_ENGINE_DATADIR, @@ -131,26 +127,10 @@ 'ovirt-engine.conf', ) - LEGACY_OVIRT_ENGINE_SYSCONFIG = os.path.join( - SYSCONFDIR, - 'sysconfig', - 'ovirt-engine', - ) - - LEGACY_PSQL_PASS_FILE = os.path.join( - OVIRT_ENGINE_SYSCONFDIR, - '.pgpass', - ) - FIREWALLD_SERVICES_DIR = os.path.join( SYSCONFDIR, 'firewalld', 'services', - ) - - LEGACY_FIREWALLD_SERVICE_FILE = os.path.join( - FIREWALLD_SERVICES_DIR, - 'ovirt.xml' ) OVIRT_ENGINE_DB_UTILS_DIR = os.path.join( @@ -425,12 +405,6 @@ 'ovirt-engine-root-redirect.conf.in', ) - HTTPD_CONF_OVIRT_ENGINE_LEGACY = os.path.join( - DIR_HTTPD, - 'conf.d', - 'ovirt-engine.conf', - ) - AIO_VDSM_PATH = os.path.join( DATADIR, 'vdsm', @@ -443,11 +417,6 @@ AIO_POST_INSTALL_CONFIG = os.path.join( '%s.d' % OVIRT_OVIRT_SETUP_CONFIG_FILE, '20-setup-aio.conf' - ) - - EXTRACTED_PRODUCTKEYS = os.path.join( - OVIRT_ENGINE_OSINFO_REPOSITORY_DIR, - '10-productkeys.properties', ) @@ -574,9 +543,6 @@ AIO_CONFIG_SSH = 'osetup.aio.config.ssh' AIO_CONFIG_VDSM = 'osetup.aio.config.vdsm' - UPGRADE_FROM_LEGACY_CONFIG = 'osetup.legacy.upgrade' - LEGACY_CORE_INIT = 'osetup.legacy.core.init' - REMOVE_CUSTOMIZATION_COMMON = 'osetup.remove.customization.common' REMOVE_CUSTOMIZATION_GROUPS = 'osetup.remove.customization.groups' REMOVE_FIREWALLD_SERVICES = 'osetup.remove.firewalld.services' @@ -654,7 +620,6 @@ LINES_GROUP_PREFIX = 'OVESETUP_CORE_MODIFIED_LINES_GROUP/' REGISTER_UNINSTALL_GROUPS = 'OVESETUP_CORE/registerUninstallGroups' UPGRADE_SUPPORTED_VERSIONS = 'OVESETUP_CORE/upgradeSupportedVersions' - UPGRADE_FROM_LEGACY = 'OVESETUP_CORE/upgradeFromLegacy' ACTION = 'OVESETUP_CORE/action' @osetupattrs( @@ -676,8 +641,6 @@ return 'OVESETUP_CORE/generatedByVersion' ORIGINAL_GENERATED_BY_VERSION = 'OVESETUP_CORE/originalGeneratedByVersion' - - LEGACY_PG_CREDS_FOUND = 'OVESETUP_CORE/legacyPGCredsFound' SETUP_ATTRS_MODULES = 'OVESETUP_CORE/setupAttributesModules' diff --git a/packaging/setup/plugins/ovirt-engine-setup/config/__init__.py b/packaging/setup/plugins/ovirt-engine-setup/config/__init__.py index 4eb1f37..52d499b 100644 --- a/packaging/setup/plugins/ovirt-engine-setup/config/__init__.py +++ b/packaging/setup/plugins/ovirt-engine-setup/config/__init__.py @@ -35,7 +35,6 @@ from . import iso_domain from . import macrange from . import websocket_proxy -from . import productkey_upgrade @util.export @@ -53,7 +52,6 @@ iso_domain.Plugin(context=context) macrange.Plugin(context=context) websocket_proxy.Plugin(context=context) - productkey_upgrade.Plugin(context=context) # vim: expandtab tabstop=4 shiftwidth=4 diff --git a/packaging/setup/plugins/ovirt-engine-setup/config/productkey_upgrade.py b/packaging/setup/plugins/ovirt-engine-setup/config/productkey_upgrade.py deleted file mode 100644 index 641ca0b..0000000 --- a/packaging/setup/plugins/ovirt-engine-setup/config/productkey_upgrade.py +++ /dev/null @@ -1,90 +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. -# - - -"""Product key plugin.""" - -import os -import gettext -_ = lambda m: gettext.dgettext(message=m, domain='ovirt-engine-setup') - - -from otopi import constants as otopicons -from otopi import util -from otopi import filetransaction -from otopi import plugin - - -from ovirt_engine_setup import constants as osetupcons - - [email protected] -class Plugin(plugin.PluginBase): - """Product key plugin.""" - - DB_TO_OSINFO = { - 'ProductKey2003': 'windows_2003', - 'ProductKey2003x64': 'windows_2003x64', - 'ProductKey2008': 'windows_2008', - 'ProductKey2008R2': 'windows_2008R2x64', - 'ProductKey2008x64': 'windows_2008x64', - 'ProductKey': 'windows_xp', - 'ProductKeyWindow7': 'windows_7', - 'ProductKeyWindow7x64': 'windows_7x64', - 'ProductKeyWindows8': 'windows_8', - 'ProductKeyWindows8x64': 'windows_8x64', - 'ProductKeyWindows2012x64': 'windows_2012x64', - } - - def __init__(self, context): - super(Plugin, self).__init__(context=context) - - @plugin.event( - stage=plugin.Stages.STAGE_MISC, - after=( - osetupcons.Stages.DB_CONNECTION_AVAILABLE, - ), - condition=lambda self: not os.path.exists( - osetupcons.FileLocations.EXTRACTED_PRODUCTKEYS - ), - ) - def _misc(self): - content = [] - for key in self.DB_TO_OSINFO.keys(): - val = self.environment[ - osetupcons.DBEnv.STATEMENT - ].getVdcOption(key) - if val: - content.append( - 'os.%s.productKey.value=%s' % ( - self.DB_TO_OSINFO[key], - val, - ) - ) - - if content: - self.environment[otopicons.CoreEnv.MAIN_TRANSACTION].append( - filetransaction.FileTransaction( - name=osetupcons.FileLocations.EXTRACTED_PRODUCTKEYS, - content=content, - modifiedList=self.environment[ - otopicons.CoreEnv.MODIFIED_FILES - ], - ) - ) - -# vim: expandtab tabstop=4 shiftwidth=4 diff --git a/packaging/setup/plugins/ovirt-engine-setup/core/misc.py b/packaging/setup/plugins/ovirt-engine-setup/core/misc.py index 4c122b4..248cc44 100644 --- a/packaging/setup/plugins/ovirt-engine-setup/core/misc.py +++ b/packaging/setup/plugins/ovirt-engine-setup/core/misc.py @@ -60,11 +60,8 @@ priority=plugin.Stages.PRIORITY_LOW ) def _init(self): - if ( - self.environment[osetupcons.CoreEnv.UPGRADE_FROM_LEGACY] or - os.path.exists( - osetupcons.FileLocations.OVIRT_SETUP_POST_INSTALL_CONFIG - ) + if os.path.exists( + osetupcons.FileLocations.OVIRT_SETUP_POST_INSTALL_CONFIG ): self.environment[ osetupcons.CoreEnv.ACTION diff --git a/packaging/setup/plugins/ovirt-engine-setup/legacy/__init__.py b/packaging/setup/plugins/ovirt-engine-setup/legacy/__init__.py deleted file mode 100644 index 8f9f4e0..0000000 --- a/packaging/setup/plugins/ovirt-engine-setup/legacy/__init__.py +++ /dev/null @@ -1,49 +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-setup core plugin.""" - - -from otopi import util - - -from . import apache -from . import config -from . import core -from . import datadomain -from . import firewall_manager -from . import firewalld -from . import isodomain -from . import database -from . import ca - - [email protected] -def createPlugins(context): - apache.Plugin(context=context) - config.Plugin(context=context) - core.Plugin(context=context) - datadomain.Plugin(context=context) - firewall_manager.Plugin(context=context) - firewalld.Plugin(context=context) - isodomain.Plugin(context=context) - database.Plugin(context=context) - ca.Plugin(context=context) - - -# vim: expandtab tabstop=4 shiftwidth=4 diff --git a/packaging/setup/plugins/ovirt-engine-setup/legacy/apache.py b/packaging/setup/plugins/ovirt-engine-setup/legacy/apache.py deleted file mode 100644 index baf1238..0000000 --- a/packaging/setup/plugins/ovirt-engine-setup/legacy/apache.py +++ /dev/null @@ -1,87 +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. -# - - -"""Upgrade Apache configuration from legacy plugin.""" - - -import os -import gettext -_ = lambda m: gettext.dgettext(message=m, domain='ovirt-engine-setup') - - -from otopi import util -from otopi import plugin -from otopi import constants as otopicons -from otopi import filetransaction - - -from ovirt_engine_setup import constants as osetupcons - - [email protected] -class Plugin(plugin.PluginBase): - """Upgrade Apache configuration from legacy plugin.""" - - def __init__(self, context): - super(Plugin, self).__init__(context=context) - self._enabled = False - - @plugin.event( - stage=plugin.Stages.STAGE_SETUP, - condition=lambda self: not self.environment[ - osetupcons.CoreEnv.DEVELOPER_MODE - ], - ) - def _setup(self): - self._enabled = ( - self.environment[osetupcons.CoreEnv.UPGRADE_FROM_LEGACY] and - os.path.exists( - osetupcons.FileLocations.HTTPD_CONF_OVIRT_ENGINE_LEGACY - ) - ) - - @plugin.event( - stage=plugin.Stages.STAGE_MISC, - condition=lambda self: self._enabled, - ) - def _misc(self): - self.environment[osetupcons.ApacheEnv.NEED_RESTART] = True - #creates a backup and allows rollback - self.environment[otopicons.CoreEnv.MAIN_TRANSACTION].append( - filetransaction.FileTransaction( - name=( - osetupcons.FileLocations. - HTTPD_CONF_OVIRT_ENGINE_LEGACY - ), - content='', - ) - ) - - @plugin.event( - stage=plugin.Stages.STAGE_CLOSEUP, - condition=lambda self: self._enabled, - before=( - osetupcons.Stages.APACHE_RESTART, - ), - ) - def _closeup(self): - self.environment[osetupcons.ApacheEnv.NEED_RESTART] = True - os.remove(osetupcons.FileLocations.HTTPD_CONF_OVIRT_ENGINE_LEGACY) - - -# vim: expandtab tabstop=4 shiftwidth=4 diff --git a/packaging/setup/plugins/ovirt-engine-setup/legacy/ca.py b/packaging/setup/plugins/ovirt-engine-setup/legacy/ca.py deleted file mode 100644 index d19efd2..0000000 --- a/packaging/setup/plugins/ovirt-engine-setup/legacy/ca.py +++ /dev/null @@ -1,157 +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. -# - - -"""Allow CA pki cleanup on upgrade from legacy plugin.""" - - -import os -import gettext -_ = lambda m: gettext.dgettext(message=m, domain='ovirt-engine-setup') - - -from otopi import constants as otopicons -from otopi import util -from otopi import plugin -from otopi import filetransaction - - -from ovirt_engine_setup import constants as osetupcons - - [email protected] -class Plugin(plugin.PluginBase): - """Allow CA pki cleanup on upgrade from legacy plugin.""" - - def __init__(self, context): - super(Plugin, self).__init__(context=context) - self._enabled = False - - @plugin.event( - stage=plugin.Stages.STAGE_VALIDATION, - condition=lambda self: ( - self.environment[ - osetupcons.CoreEnv.UPGRADE_FROM_LEGACY - ] and - self.environment[ - osetupcons.ConfigEnv.JBOSS_DIRECT_HTTP_PORT - ] is not None - ), - ) - def _validation(self): - self._enabled = True - - @plugin.event( - stage=plugin.Stages.STAGE_MISC, - condition=lambda self: self._enabled, - ) - def _updateAIA(self): - replace = { - 'from': ':%s/' % self.environment[ - osetupcons.ConfigEnv.JBOSS_DIRECT_HTTP_PORT - ], - 'to': ':%s/' % self.environment[ - osetupcons.ConfigEnv.PUBLIC_HTTP_PORT - ], - } - for name in ( - osetupcons.FileLocations.OVIRT_ENGINE_PKI_CA_TEMPLATE[ - :-len('.in') - ], - osetupcons.FileLocations.OVIRT_ENGINE_PKI_CA_CERT_CONF, - osetupcons.FileLocations.OVIRT_ENGINE_PKI_CERT_TEMPLATE[ - :-len('.in') - ], - osetupcons.FileLocations.OVIRT_ENGINE_PKI_CERT_CONF, - ): - with open(name, 'r') as f: - self.environment[otopicons.CoreEnv.MAIN_TRANSACTION].append( - filetransaction.FileTransaction( - name=name, - content=f.read().replace( - replace['from'], - replace['to'] - ).splitlines(), - modifiedList=self.environment[ - otopicons.CoreEnv.MODIFIED_FILES - ], - ) - ) - - @plugin.event( - stage=plugin.Stages.STAGE_MISC, - condition=lambda self: ( - self.environment[osetupcons.CoreEnv.UPGRADE_FROM_LEGACY] - ), - ) - def _misc(self): - uninstall_files = [] - for name in ( - osetupcons.FileLocations. - OVIRT_ENGINE_PKI_CA_TEMPLATE[:-len('.in')], - osetupcons.FileLocations. - OVIRT_ENGINE_PKI_CERT_TEMPLATE[:-len('.in')], - osetupcons.FileLocations.OVIRT_ENGINE_PKI_APACHE_CERT, - osetupcons.FileLocations.OVIRT_ENGINE_PKI_APACHE_STORE, - osetupcons.FileLocations.OVIRT_ENGINE_PKI_ENGINE_CA_CERT, - osetupcons.FileLocations.OVIRT_ENGINE_PKI_ENGINE_CA_KEY, - osetupcons.FileLocations.OVIRT_ENGINE_PKI_ENGINE_CERT, - osetupcons.FileLocations.OVIRT_ENGINE_PKI_ENGINE_STORE, - osetupcons.FileLocations.OVIRT_ENGINE_PKI_ENGINE_TRUST_STORE, - osetupcons.FileLocations.OVIRT_ENGINE_PKI_JBOSS_STORE, - osetupcons.FileLocations.OVIRT_ENGINE_PKI_CA_CERT_CONF, - osetupcons.FileLocations.OVIRT_ENGINE_PKI_CERT_CONF, - osetupcons.FileLocations.OVIRT_ENGINE_PKI_ENGINE_SSH_KEY, - osetupcons.FileLocations.OVIRT_ENGINE_PKI_APACHE_KEY, - osetupcons.FileLocations.OVIRT_ENGINE_PKI_APACHE_CA_CERT, - ): - if os.path.exists(name): - uninstall_files.append(name) - - self.environment[ - osetupcons.CoreEnv.REGISTER_UNINSTALL_GROUPS - ].createGroup( - group='ca_pki', - description='PKI keys', - optional=True, - ).addFiles( - group='ca_pki', - fileList=uninstall_files, - ) - - @plugin.event( - stage=plugin.Stages.STAGE_CLOSEUP, - condition=lambda self: self._enabled, - ) - def _closeup(self): - self.logger.warning( - _( - 'Engine port was modified from port {oldport} to {newport}.\n' - 'Consider to run rename script to re-issue web certificate ' - 'with current port within AIA extension.\n' - ).format( - oldport=self.environment[ - osetupcons.ConfigEnv.JBOSS_DIRECT_HTTP_PORT - ], - newport=self.environment[ - osetupcons.ConfigEnv.PUBLIC_HTTP_PORT - ], - ) - ) - - -# vim: expandtab tabstop=4 shiftwidth=4 diff --git a/packaging/setup/plugins/ovirt-engine-setup/legacy/config.py b/packaging/setup/plugins/ovirt-engine-setup/legacy/config.py deleted file mode 100644 index 7e40b99..0000000 --- a/packaging/setup/plugins/ovirt-engine-setup/legacy/config.py +++ /dev/null @@ -1,167 +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. -# - - -"""Upgrade configuration from legacy plugin.""" - - -import os -import glob -import gettext -_ = lambda m: gettext.dgettext(message=m, domain='ovirt-engine-setup') - - -from otopi import util -from otopi import plugin -from otopi import constants as otopicons -from otopi import filetransaction - - -from ovirt_engine import configfile - - -from ovirt_engine_setup import constants as osetupcons - - [email protected] -class Plugin(plugin.PluginBase): - """Upgrade configuration from legacy plugin.""" - - def __init__(self, context): - super(Plugin, self).__init__(context=context) - - @plugin.event( - stage=plugin.Stages.STAGE_CUSTOMIZATION, - condition=lambda self: self.environment[ - osetupcons.CoreEnv.UPGRADE_FROM_LEGACY - ], - priority=plugin.Stages.PRIORITY_FIRST, - name=osetupcons.Stages.UPGRADE_FROM_LEGACY_CONFIG - ) - def _customization(self): - legacy = osetupcons.FileLocations.LEGACY_OVIRT_ENGINE_SYSCONFIG - config = None - for filename in ( - legacy, - legacy + '.rpmsave', - ): - if os.path.exists(filename): - self.logger.debug('Upgrading from 3.2.z') - self.environment[ - osetupcons.ApacheEnv.CONFIGURE_ROOT_REDIRECTION - ] = True - config = configfile.ConfigFile([ - filename, - ]) - break - if config is None: - self.logger.debug('Upgrading from 3.3.z legacy') - config = configfile.ConfigFile([ - osetupcons.FileLocations.OVIRT_ENGINE_SERVICE_CONFIG - ]) - - #preserve engine http and https ports. - if config.getboolean('ENGINE_HTTP_ENABLED'): - self.environment[ - osetupcons.ConfigEnv.JBOSS_DIRECT_HTTP_PORT - ] = config.get('ENGINE_HTTP_PORT') - - if config.getboolean('ENGINE_HTTPS_ENABLED'): - self.environment[ - osetupcons.ConfigEnv.JBOSS_DIRECT_HTTPS_PORT - ] = config.get('ENGINE_HTTPS_PORT') - - self.environment[osetupcons.ConfigEnv.FQDN] = config.get('ENGINE_FQDN') - if not config.getboolean('ENGINE_PROXY_ENABLED'): - self.environment[osetupcons.ApacheEnv.CONFIGURE_SSL] = True - else: - #if it's enabled it has been already done - self.environment[osetupcons.ApacheEnv.CONFIGURE_SSL] = False - for key in ( - otopicons.CoreEnv.MODIFIED_FILES, - osetupcons.CoreEnv.UNINSTALL_UNREMOVABLE_FILES, - ): - self.environment[key].append( - self.environment[ - osetupcons.ApacheEnv.HTTPD_CONF_SSL - ] - ) - self.environment[osetupcons.DBEnv.SECURED] = config.getboolean( - name='ENGINE_DB_SECURED', - default='ssl=true' in config.get( - 'ENGINE_DB_URL', - '', - ) - ) - self.environment[ - osetupcons.DBEnv.SECURED_HOST_VALIDATION - ] = config.getboolean( - name='ENGINE_DB_SECURED_VALIDATION', - default=False, - ) - - @plugin.event( - stage=plugin.Stages.STAGE_MISC, - condition=lambda self: self.environment[ - osetupcons.CoreEnv.UPGRADE_FROM_LEGACY - ], - ) - def _misc(self): - legacy = osetupcons.FileLocations.LEGACY_OVIRT_ENGINE_SYSCONFIG - legacy_rpmsave = legacy + '.rpmsave' - legacy_confd = legacy + '.d' - - # yum update renamed it. Here we rename back, so that if a failure - # causes a rollback to previous packages, the conf file will already - # be in place. - if os.path.exists(legacy_rpmsave) and not os.path.exists(legacy): - os.rename(legacy_rpmsave, legacy) - - if os.path.exists(legacy_confd): - for n in glob.glob(os.path.join(legacy_confd, '*.conf')): - with open(n, 'r') as f: - self.environment[ - otopicons.CoreEnv.MAIN_TRANSACTION - ].append( - filetransaction.FileTransaction( - name=os.path.join( - ( - osetupcons.FileLocations. - OVIRT_ENGINE_SERVICE_CONFIGD - ), - os.path.basename(n), - ), - content=f.read().splitlines(), - ) - ) - - @plugin.event( - stage=plugin.Stages.STAGE_CLOSEUP, - condition=lambda self: self.environment[ - osetupcons.CoreEnv.UPGRADE_FROM_LEGACY - ], - ) - def _closeup(self): - legacy = osetupcons.FileLocations.LEGACY_OVIRT_ENGINE_SYSCONFIG - legacy_rpmsave = legacy + '.rpmsave' - - # Here we don't need it anymore, and rename back - if os.path.exists(legacy) and not os.path.exists(legacy_rpmsave): - os.rename(legacy, legacy_rpmsave) - - -# vim: expandtab tabstop=4 shiftwidth=4 diff --git a/packaging/setup/plugins/ovirt-engine-setup/legacy/core.py b/packaging/setup/plugins/ovirt-engine-setup/legacy/core.py deleted file mode 100644 index 0d6878b..0000000 --- a/packaging/setup/plugins/ovirt-engine-setup/legacy/core.py +++ /dev/null @@ -1,84 +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. -# - - -"""Detect upgrade from legacy plugin.""" - - -import os -import gettext -_ = lambda m: gettext.dgettext(message=m, domain='ovirt-engine-setup') - - -from otopi import util -from otopi import plugin - - -from ovirt_engine_setup import constants as osetupcons - - [email protected] -class Plugin(plugin.PluginBase): - """Detect upgrade from legacy plugin.""" - - def __init__(self, context): - super(Plugin, self).__init__(context=context) - - @plugin.event( - name=osetupcons.Stages.LEGACY_CORE_INIT, - stage=plugin.Stages.STAGE_INIT, - ) - def _init(self): - if self.environment[osetupcons.CoreEnv.DEVELOPER_MODE]: - self.environment[osetupcons.CoreEnv.UPGRADE_FROM_LEGACY] = False - else: - versionLocked = False - if os.path.exists( - osetupcons.FileLocations.OVIRT_ENGINE_YUM_VERSIONLOCK - ): - with open( - osetupcons.FileLocations.OVIRT_ENGINE_YUM_VERSIONLOCK, - 'r' - ) as f: - versionLocked = ( - '%s-backend' % osetupcons.Const.PACKAGE_NAME - ) in f.read() - self.logger.debug('versionLocked=%s', versionLocked) - - self.environment[osetupcons.CoreEnv.UPGRADE_FROM_LEGACY] = ( - # This one should exist only after a 3.3+ setup - not os.path.exists( - osetupcons.FileLocations.OVIRT_SETUP_POST_INSTALL_CONFIG - ) and - # This one should exist after any setup. It even exists - # after a partial cleanup. Perhaps it's best to not check - # it at all... - os.path.exists( - osetupcons.FileLocations.OVIRT_ENGINE_PKI_ENGINE_CA_CERT - ) and - # The following ones should exist only after a 3.2 legacy setup - os.path.exists( - osetupcons.FileLocations.LEGACY_OVIRT_ENGINE_SYSCONFIG - ) and - self.environment[ - osetupcons.CoreEnv.LEGACY_PG_CREDS_FOUND - ] and - versionLocked - ) - - -# vim: expandtab tabstop=4 shiftwidth=4 diff --git a/packaging/setup/plugins/ovirt-engine-setup/legacy/database.py b/packaging/setup/plugins/ovirt-engine-setup/legacy/database.py deleted file mode 100644 index c4d7205..0000000 --- a/packaging/setup/plugins/ovirt-engine-setup/legacy/database.py +++ /dev/null @@ -1,132 +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. -# - - -"""Database legacy migration.""" - - -import os -import gettext -_ = lambda m: gettext.dgettext(message=m, domain='ovirt-engine-setup') - - -from otopi import constants as otopicons -from otopi import filetransaction -from otopi import util -from otopi import plugin - - -from ovirt_engine_setup import constants as osetupcons -from ovirt_engine_setup import database - - [email protected] -class Plugin(plugin.PluginBase): - """Connection plugin.""" - - def __init__(self, context): - super(Plugin, self).__init__(context=context) - - @plugin.event( - stage=plugin.Stages.STAGE_INIT, - before=( - osetupcons.Stages.LEGACY_CORE_INIT, - ), - ) - def _init(self): - self.environment[ - osetupcons.CoreEnv.LEGACY_PG_CREDS_FOUND - ] = False - if os.path.exists( - osetupcons.FileLocations.LEGACY_PSQL_PASS_FILE - ): - self.logger.debug('Existing database pgpass found') - with open( - osetupcons.FileLocations.LEGACY_PSQL_PASS_FILE, - 'r', - ) as f: - for l in f: - l = l.rstrip('\n') - if ':%s:' % 'postgres' not in l: - d = l.split(':') - if len(d) == 5: - self._dbenv = { - osetupcons.DBEnv.HOST: d[0], - osetupcons.DBEnv.PORT: int(d[1]), - osetupcons.DBEnv.SECURED: None, - osetupcons.DBEnv.SECURED_HOST_VALIDATION: None, - osetupcons.DBEnv.DATABASE: ( - d[2] if d[2] != '*' - else - osetupcons.Defaults.DEFAULT_DB_DATABASE - ), - osetupcons.DBEnv.USER: d[3], - osetupcons.DBEnv.PASSWORD: d[4], - osetupcons.DBEnv.NEW_DATABASE: False, - } - self.environment[ - osetupcons.CoreEnv.LEGACY_PG_CREDS_FOUND - ] = True - - # In legacy we always have engine user defined - # before the rhevm user, as that's how we - # upgraded from 3.0; in other installations - # we will not have more than 1 user (engine) - # As such, we should use the first user we find. - break - - @plugin.event( - stage=plugin.Stages.STAGE_SETUP, - before=( - osetupcons.Stages.DB_CONNECTION_SETUP, - ), - condition=lambda self: self.environment[ - osetupcons.CoreEnv.UPGRADE_FROM_LEGACY - ], - ) - def _setup(self): - self.environment.update(self._dbenv) - self.environment[ - otopicons.CoreEnv.LOG_FILTER - ].append( - self.environment[osetupcons.DBEnv.PASSWORD] - ) - dbovirtutils = database.OvirtUtils(plugin=self) - dbovirtutils.tryDatabaseConnect() - if dbovirtutils.isNewDatabase(): - raise RuntimeError( - _('Unexpected empty database during upgrade') - ) - - @plugin.event( - stage=plugin.Stages.STAGE_MISC, - condition=lambda self: self.environment[ - osetupcons.CoreEnv.UPGRADE_FROM_LEGACY - ], - ) - def _misc(self): - self.environment[otopicons.CoreEnv.MAIN_TRANSACTION].append( - filetransaction.FileTransaction( - name=( - osetupcons.FileLocations.LEGACY_PSQL_PASS_FILE - ), - content='', - ) - ) - - -# vim: expandtab tabstop=4 shiftwidth=4 diff --git a/packaging/setup/plugins/ovirt-engine-setup/legacy/datadomain.py b/packaging/setup/plugins/ovirt-engine-setup/legacy/datadomain.py deleted file mode 100644 index 4e79687..0000000 --- a/packaging/setup/plugins/ovirt-engine-setup/legacy/datadomain.py +++ /dev/null @@ -1,124 +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. -# - - -"""Upgrade configuration from legacy plugin.""" - - -import gettext -_ = lambda m: gettext.dgettext(message=m, domain='ovirt-engine-setup') - - -from otopi import util -from otopi import plugin -from otopi import constants as otopicons -from otopi import filetransaction - - -from ovirt_engine_setup import constants as osetupcons -from ovirt_engine_setup import database -from ovirt_engine_setup import domains - - [email protected] -class Plugin(plugin.PluginBase): - """Upgrade configuration from legacy plugin.""" - - def __init__(self, context): - super(Plugin, self).__init__(context=context) - self._aio_already_configured = False - - @plugin.event( - stage=plugin.Stages.STAGE_CUSTOMIZATION, - condition=lambda self: self.environment[ - osetupcons.CoreEnv.UPGRADE_FROM_LEGACY - ], - after=( - osetupcons.Stages.UPGRADE_FROM_LEGACY_CONFIG, - ), - before=( - osetupcons.Stages.AIO_CONFIG_AVAILABLE, - ), - ) - def _customization(self): - dbovirtutils = database.OvirtUtils(plugin=self) - dbovirtutils.tryDatabaseConnect() - dbstatement = database.Statement(environment=self.environment) - rows = dbstatement.execute( - statement=""" - select - id, - storage, - storage_name - from storage_domain_static - where - storage_type=%(storage_type)s and - storage_domain_type=%(storage_domain_type)s - """, - args=dict( - storage_type=domains.StorageType.LOCALFS, - storage_domain_type=domains.StorageDomainType.MASTER, - ), - ownConnection=True, - ) - for domain in rows: - conn_row = dbstatement.execute( - statement=""" - select - connection - from storage_server_connections - where - id=%(storage)s - """, - args=dict( - storage=domain['storage'] - ), - ownConnection=True, - )[0] - #returns only one line, can't exists duplicate and must exist one - path = conn_row['connection'] - self.environment[osetupcons.AIOEnv.CONFIGURE] = False - self.environment[osetupcons.AIOEnv.ENABLE] = False - self.environment[ - osetupcons.AIOEnv.STORAGE_DOMAIN_DIR - ] = path - self.environment[ - osetupcons.AIOEnv.STORAGE_DOMAIN_NAME - ] = domain['storage_name'] - self._aio_already_configured = True - break - - @plugin.event( - stage=plugin.Stages.STAGE_MISC, - condition=lambda self: self._aio_already_configured, - ) - def _misc(self): - self.environment[otopicons.CoreEnv.MAIN_TRANSACTION].append( - filetransaction.FileTransaction( - name=osetupcons.FileLocations.AIO_POST_INSTALL_CONFIG, - content=( - '[environment:default]', - 'OVESETUP_AIO/enable=bool:False', - ), - modifiedList=self.environment[ - otopicons.CoreEnv.MODIFIED_FILES - ], - ) - ) - - -# vim: expandtab tabstop=4 shiftwidth=4 diff --git a/packaging/setup/plugins/ovirt-engine-setup/legacy/firewall_manager.py b/packaging/setup/plugins/ovirt-engine-setup/legacy/firewall_manager.py deleted file mode 100644 index 0809404..0000000 --- a/packaging/setup/plugins/ovirt-engine-setup/legacy/firewall_manager.py +++ /dev/null @@ -1,65 +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. -# - - -"""Upgrade firewall configuration from legacy plugin.""" - - -import gettext -_ = lambda m: gettext.dgettext(message=m, domain='ovirt-engine-setup') - - -from otopi import util -from otopi import plugin - - -from ovirt_engine_setup import constants as osetupcons - - [email protected] -class Plugin(plugin.PluginBase): - """Upgrade firewall configuration from legacy plugin.""" - - def __init__(self, context): - super(Plugin, self).__init__(context=context) - - @plugin.event( - stage=plugin.Stages.STAGE_CUSTOMIZATION, - condition=lambda self: self.environment[ - osetupcons.CoreEnv.UPGRADE_FROM_LEGACY - ], - before=( - osetupcons.Stages.NET_FIREWALL_MANAGER_AVAILABLE, - ), - ) - def _customization(self): - managers = [] - if self.services.exists('firewalld'): - managers.append('firewalld') - if self.services.exists('iptables'): - managers.append('iptables') - for manager in managers: - if ( - self.services.exists(manager) and - self.services.status(manager) - ): - self.environment[ - osetupcons.ConfigEnv.FIREWALL_MANAGER - ] = manager - - -# vim: expandtab tabstop=4 shiftwidth=4 diff --git a/packaging/setup/plugins/ovirt-engine-setup/legacy/firewalld.py b/packaging/setup/plugins/ovirt-engine-setup/legacy/firewalld.py deleted file mode 100644 index e5e92ea..0000000 --- a/packaging/setup/plugins/ovirt-engine-setup/legacy/firewalld.py +++ /dev/null @@ -1,85 +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. -# - - -"""Upgrade firewalld configuration from legacy plugin.""" - - -import os -import gettext -_ = lambda m: gettext.dgettext(message=m, domain='ovirt-engine-setup') - - -from otopi import util -from otopi import plugin -from otopi import constants as otopicons - - -from ovirt_engine_setup import constants as osetupcons - - [email protected] -class Plugin(plugin.PluginBase): - """Upgrade firewalld configuration from legacy plugin.""" - - def __init__(self, context): - super(Plugin, self).__init__(context=context) - - @plugin.event( - stage=plugin.Stages.STAGE_VALIDATION, - condition=lambda self: self.environment[ - osetupcons.CoreEnv.UPGRADE_FROM_LEGACY - ], - # TODO: add: - # before=( - # otopicons.Stages.FIREWALLD_VALIDATION, - #), - # and remove: - priority=plugin.Stages.PRIORITY_HIGH, - ) - def _validation(self): - if os.path.exists( - osetupcons.FileLocations.LEGACY_FIREWALLD_SERVICE_FILE - ): - self.environment[ - otopicons.NetEnv.FIREWALLD_DISABLE_SERVICES - ].append( - os.path.splitext( - os.path.basename( - osetupcons.FileLocations. - LEGACY_FIREWALLD_SERVICE_FILE - ) - )[0] - ) - - @plugin.event( - stage=plugin.Stages.STAGE_CLOSEUP, - condition=lambda self: self.environment[ - osetupcons.CoreEnv.UPGRADE_FROM_LEGACY - ], - priority=plugin.Stages.PRIORITY_LOW, - ) - def _closeup(self): - #Priority low because we want to remove the file after firewalld - #plugin closeup - if os.path.exists( - osetupcons.FileLocations.LEGACY_FIREWALLD_SERVICE_FILE - ): - os.remove(osetupcons.FileLocations.LEGACY_FIREWALLD_SERVICE_FILE) - - -# vim: expandtab tabstop=4 shiftwidth=4 diff --git a/packaging/setup/plugins/ovirt-engine-setup/legacy/isodomain.py b/packaging/setup/plugins/ovirt-engine-setup/legacy/isodomain.py deleted file mode 100644 index 70bae5c..0000000 --- a/packaging/setup/plugins/ovirt-engine-setup/legacy/isodomain.py +++ /dev/null @@ -1,170 +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. -# - - -"""Upgrade configuration from legacy plugin.""" - - -import os -import gettext -_ = lambda m: gettext.dgettext(message=m, domain='ovirt-engine-setup') - - -from otopi import util -from otopi import plugin - - -from ovirt_engine_setup import constants as osetupcons -from ovirt_engine_setup import database -from ovirt_engine_setup import domains - - [email protected] -class Plugin(plugin.PluginBase): - """Upgrade configuration from legacy plugin.""" - - def __init__(self, context): - super(Plugin, self).__init__(context=context) - - @plugin.event( - stage=plugin.Stages.STAGE_CUSTOMIZATION, - condition=lambda self: self.environment[ - osetupcons.CoreEnv.UPGRADE_FROM_LEGACY - ], - after=( - osetupcons.Stages.UPGRADE_FROM_LEGACY_CONFIG, - ), - before=( - osetupcons.Stages.SYSTEM_NFS_CONFIG_AVAILABLE, - osetupcons.Stages.CONFIG_ISO_DOMAIN_AVAILABLE, - ), - ) - def _customization(self): - dbovirtutils = database.OvirtUtils(plugin=self) - dbovirtutils.tryDatabaseConnect() - dbstatement = database.Statement(environment=self.environment) - rows = dbstatement.execute( - statement=""" - select - id, - storage, - storage_name - from storage_domain_static - where - storage_type=%(storage_type)s and - storage_domain_type=%(storage_domain_type)s - """, - args=dict( - storage_type=domains.StorageType.NFS, - storage_domain_type=domains.StorageDomainType.ISO, - ), - ownConnection=True, - ) - for domain in rows: - conn_row = dbstatement.execute( - statement=""" - select - connection - from storage_server_connections - where - id=%(storage)s - """, - args=dict( - storage=domain['storage'] - ), - ownConnection=True, - )[0] - #returns only one line, can't exists duplicate and must exist one - host, path = conn_row['connection'].split(':') - if host == self.environment[osetupcons.ConfigEnv.FQDN]: - self.environment[ - osetupcons.ConfigEnv.ISO_DOMAIN_EXISTS - ] = True - self.environment[ - osetupcons.SystemEnv.NFS_CONFIG_ENABLED - ] = True - self.environment[ - osetupcons.ConfigEnv.ISO_DOMAIN_NFS_MOUNT_POINT - ] = path - self.environment[ - osetupcons.ConfigEnv.ISO_DOMAIN_NAME - ] = domain['storage_name'] - self.environment[ - osetupcons.ConfigEnv.ISO_DOMAIN_SD_UUID - ] = domain['id'] - self.environment[ - osetupcons.ConfigEnv.ISO_DOMAIN_STORAGE_DIR - ] = os.path.join( - self.environment[ - osetupcons.ConfigEnv.ISO_DOMAIN_NFS_MOUNT_POINT - ], - self.environment[ - osetupcons.ConfigEnv.ISO_DOMAIN_SD_UUID - ], - 'images', - osetupcons.Const.ISO_DOMAIN_IMAGE_UID, - ) - break - - @plugin.event( - stage=plugin.Stages.STAGE_MISC, - condition=lambda self: ( - self.environment[osetupcons.CoreEnv.UPGRADE_FROM_LEGACY] and - self.environment[osetupcons.ConfigEnv.ISO_DOMAIN_EXISTS] - ), - ) - def _misc(self): - uninstall_files = [ - os.path.join( - self.environment[osetupcons.ConfigEnv.ISO_DOMAIN_STORAGE_DIR], - '.keep' - ), - ] - dom_md = os.path.join( - self.environment[ - osetupcons.ConfigEnv.ISO_DOMAIN_NFS_MOUNT_POINT - ], - self.environment[ - osetupcons.ConfigEnv.ISO_DOMAIN_SD_UUID - ], - 'dom_md' - ) - for filename in ( - 'ids', - 'inbox', - 'leases', - 'metadata', - 'outbox', - ): - uninstall_files.append( - os.path.join( - dom_md, - filename - ) - ) - self.environment[ - osetupcons.CoreEnv.REGISTER_UNINSTALL_GROUPS - ].createGroup( - group='iso_domain', - description='ISO domain layout', - optional=True - ).addFiles( - group='iso_domain', - fileList=uninstall_files, - ) - -# vim: expandtab tabstop=4 shiftwidth=4 -- To view, visit http://gerrit.ovirt.org/22149 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9a798929fb5c831ca46900da6caa1b03a2600555 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Alon Bar-Lev <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
