Alon Bar-Lev has uploaded a new change for review.

Change subject: packaging: setup: remove system localstate
......................................................................

packaging: setup: remove system localstate

these issues are per 3.2 issues, will not exist post 3.3.

should have been in legacy.

Change-Id: Ie998aa70853464d60e4f0573e5fe1cd437d9d948
Signed-off-by: Alon Bar-Lev <alo...@redhat.com>
---
M Makefile
M packaging/setup/ovirt_engine_setup/config.py.in
M packaging/setup/ovirt_engine_setup/constants.py
M packaging/setup/plugins/ovirt-engine-setup/ovirt-engine/system/__init__.py
D packaging/setup/plugins/ovirt-engine-setup/ovirt-engine/system/localstate.py
5 files changed, 0 insertions(+), 98 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/77/23877/1

diff --git a/Makefile b/Makefile
index 23b8a6f..e78270c 100644
--- a/Makefile
+++ b/Makefile
@@ -62,7 +62,6 @@
 PKG_JBOSS_MODULES=$(DATA_DIR)/modules
 PKG_CACHE_DIR=$(LOCALSTATE_DIR)/cache/$(ENGINE_NAME)
 PKG_LOG_DIR=$(LOCALSTATE_DIR)/log/$(ENGINE_NAME)
-PKG_TMP_DIR=$(LOCALSTATE_DIR)/tmp/$(ENGINE_NAME)
 PKG_STATE_DIR=$(LOCALSTATE_DIR)/lib/$(ENGINE_NAME)
 PKG_TMP_DIR=$(LOCALSTATE_DIR)/tmp/$(ENGINE_NAME)
 JBOSS_HOME=/usr/share/jboss-as
diff --git a/packaging/setup/ovirt_engine_setup/config.py.in 
b/packaging/setup/ovirt_engine_setup/config.py.in
index fb42899..5a53ad7 100644
--- a/packaging/setup/ovirt_engine_setup/config.py.in
+++ b/packaging/setup/ovirt_engine_setup/config.py.in
@@ -28,7 +28,6 @@
 ENGINE_PKIDIR = '@ENGINE_PKI@'
 ENGINE_DATADIR = '@ENGINE_USR@'
 ENGINE_LOCALSTATEDIR = '@ENGINE_VAR@'
-ENGINE_TMP = '@ENGINE_TMP@'
 ENGINE_LOG = '@ENGINE_LOG@'
 PACKAGE_NAME = '@PACKAGE_NAME@'
 PACKAGE_VERSION = '@PACKAGE_VERSION@'
diff --git a/packaging/setup/ovirt_engine_setup/constants.py 
b/packaging/setup/ovirt_engine_setup/constants.py
index 1136cf9..2f64d12 100644
--- a/packaging/setup/ovirt_engine_setup/constants.py
+++ b/packaging/setup/ovirt_engine_setup/constants.py
@@ -73,7 +73,6 @@
     OVIRT_ENGINE_PKIDIR = config.ENGINE_PKIDIR
     OVIRT_ENGINE_DATADIR = config.ENGINE_DATADIR
     OVIRT_ENGINE_LOCALSTATEDIR = config.ENGINE_LOCALSTATEDIR
-    OVIRT_ENGINE_TMPDIR = config.ENGINE_TMP
     OVIRT_ENGINE_LOGDIR = config.ENGINE_LOG
     OVIRT_ENGINE_SERVICE_CONFIG = config.ENGINE_SERVICE_CONFIG
     OVIRT_ENGINE_SERVICE_CONFIG_DEFAULTS = \
@@ -177,10 +176,6 @@
     OVIRT_ENGINE_DB_MD5_DIR = os.path.join(
         OVIRT_ENGINE_LOCALSTATEDIR,
         'dbmd5',
-    )
-    OVIRT_ENGINE_DEPLOYMENTS_DIR = os.path.join(
-        OVIRT_ENGINE_LOCALSTATEDIR,
-        'deployments',
     )
     OVIRT_SETUP_STATE_DIR = os.path.join(
         OVIRT_ENGINE_LOCALSTATEDIR,
diff --git 
a/packaging/setup/plugins/ovirt-engine-setup/ovirt-engine/system/__init__.py 
b/packaging/setup/plugins/ovirt-engine-setup/ovirt-engine/system/__init__.py
index 7573d45..8d72d1b 100644
--- a/packaging/setup/plugins/ovirt-engine-setup/ovirt-engine/system/__init__.py
+++ b/packaging/setup/plugins/ovirt-engine-setup/ovirt-engine/system/__init__.py
@@ -28,7 +28,6 @@
 from . import nfs
 from . import exportfs
 from . import selinux
-from . import localstate
 
 
 @util.export
@@ -39,7 +38,6 @@
     nfs.Plugin(context=context)
     exportfs.Plugin(context=context)
     selinux.Plugin(context=context)
-    localstate.Plugin(context=context)
 
 
 # vim: expandtab tabstop=4 shiftwidth=4
diff --git 
a/packaging/setup/plugins/ovirt-engine-setup/ovirt-engine/system/localstate.py 
b/packaging/setup/plugins/ovirt-engine-setup/ovirt-engine/system/localstate.py
deleted file mode 100644
index 3ec2234..0000000
--- 
a/packaging/setup/plugins/ovirt-engine-setup/ovirt-engine/system/localstate.py
+++ /dev/null
@@ -1,89 +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.
-#
-
-
-"""
-Local state directory upgrade cleanups plugin
-"""
-
-import os
-import shutil
-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 util as osetuputil
-
-
-@util.export
-class Plugin(plugin.PluginBase):
-    """
-    Local state directory upgrade cleanups plugin.
-    Previous versions mixed root/ovirt ownership in local state directories
-    """
-
-    def __init__(self, context):
-        super(Plugin, self).__init__(context=context)
-        self._enabled = True
-
-    @plugin.event(
-        stage=plugin.Stages.STAGE_MISC,
-    )
-    def _misc(self):
-        uid = osetuputil.getUid(
-            self.environment[osetupcons.SystemEnv.USER_ENGINE]
-        )
-        gid = osetuputil.getGid(
-            self.environment[osetupcons.SystemEnv.GROUP_ENGINE]
-        )
-        if os.path.exists(osetupcons.FileLocations.OVIRT_ENGINE_TMPDIR):
-            # clean the directory only if it contains at least one file
-            # not owned by engine
-            rm_tmp_dir = False
-            for root, dirs, files in os.walk(
-                top=osetupcons.FileLocations.OVIRT_ENGINE_TMPDIR,
-                followlinks=False,
-            ):
-                for name in dirs + files:
-                    if os.stat(os.path.join(root, name)).st_uid != uid:
-                        rm_tmp_dir = True
-                        break
-                if rm_tmp_dir:
-                    break
-            if rm_tmp_dir:
-                self.logger.debug(
-                    'Cleaning {tmpdir}'.format(
-                        tmpdir=osetupcons.FileLocations.OVIRT_ENGINE_TMPDIR,
-                    )
-                )
-                shutil.rmtree(osetupcons.FileLocations.OVIRT_ENGINE_TMPDIR)
-
-        for root, dirs, files in os.walk(
-            top=osetupcons.FileLocations.OVIRT_ENGINE_DEPLOYMENTS_DIR,
-            followlinks=False,
-        ):
-            os.chown(root, uid, gid)
-            for name in dirs + files:
-                os.chown(os.path.join(root, name), uid, gid)
-
-
-# vim: expandtab tabstop=4 shiftwidth=4


-- 
To view, visit http://gerrit.ovirt.org/23877
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie998aa70853464d60e4f0573e5fe1cd437d9d948
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Alon Bar-Lev <alo...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to