From Yaniv Bronhaim <ybron...@redhat.com>:

Yaniv Bronhaim has uploaded a new change for review.

Change subject: Revert "hooking: move to lib"
......................................................................

Revert "hooking: move to lib"

This reverts commit 6687ba74e74fcd18d20fcce00349aca5adf38a30.

Change-Id: I383f3c747a45194949a8dca073c93afddda61674
Signed-off-by: Yaniv Bronhaim <ybron...@redhat.com>
---
M Makefile.am
M configure.ac
M lib/vdsm/Makefile.am
D lib/vdsm/hook/Makefile.am
D lib/vdsm/hook/__init__.py
M lib/vdsm/hooks.py
M vdsm.spec.in
M vdsm/Makefile.am
R vdsm/hooking.py
9 files changed, 7 insertions(+), 33 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/44/80444/1

diff --git a/Makefile.am b/Makefile.am
index fd126c0..6277042 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -89,6 +89,7 @@
 pylint: tox
        tox -e pylint \
                vdsm/sitecustomize.py \
+               vdsm/hooking.py \
                lib/vdsm \
                lib/vdsmclient \
                lib/yajsonrpc \
diff --git a/configure.ac b/configure.ac
index ad108bb..0b9189e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -383,7 +383,6 @@
        lib/vdsm/common/Makefile
        lib/vdsm/common/network/Makefile
        lib/vdsm/gluster/Makefile
-       lib/vdsm/hook/Makefile
        lib/vdsm/host/Makefile
        lib/vdsm/metrics/Makefile
        lib/vdsm/network/Makefile
diff --git a/lib/vdsm/Makefile.am b/lib/vdsm/Makefile.am
index 99be41b..af42de6 100644
--- a/lib/vdsm/Makefile.am
+++ b/lib/vdsm/Makefile.am
@@ -19,7 +19,7 @@
 #
 include $(top_srcdir)/build-aux/Makefile.subs
 
-SUBDIRS=api common tool profiling rpc network virt storage hook host metrics \
+SUBDIRS=api common tool profiling rpc network virt storage host metrics \
         gluster supervdsm_api
 
 dist_vdsmpylib_PYTHON = \
diff --git a/lib/vdsm/hook/Makefile.am b/lib/vdsm/hook/Makefile.am
deleted file mode 100644
index dec5bbb..0000000
--- a/lib/vdsm/hook/Makefile.am
+++ /dev/null
@@ -1,6 +0,0 @@
-vdsmhookdir = $(vdsmpylibdir)/hook
-
-dist_vdsmhook_PYTHON = \
-       __init__.py \
-       hooking.py \
-       $(NULL)
diff --git a/lib/vdsm/hook/__init__.py b/lib/vdsm/hook/__init__.py
deleted file mode 100644
index a592b0e..0000000
--- a/lib/vdsm/hook/__init__.py
+++ /dev/null
@@ -1,19 +0,0 @@
-# Copyright 2017 Red Hat, Inc.
-#
-# 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; either version 2 of the License, or
-# (at your option) any later version.
-#
-# 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
-#
-# Refer to the README and COPYING files for full details of the license
-#
-from __future__ import absolute_import
diff --git a/lib/vdsm/hooks.py b/lib/vdsm/hooks.py
index f7e9fdf..2baa2df 100644
--- a/lib/vdsm/hooks.py
+++ b/lib/vdsm/hooks.py
@@ -1,5 +1,5 @@
 #
-# Copyright 2010-2017 Red Hat, Inc.
+# Copyright 2010-2011 Red Hat, Inc.
 #
 # 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
@@ -34,7 +34,7 @@
 
 from vdsm.common import exception
 from . import commands
-from .constants import P_VDSM_HOOKS, P_VDSM_RUN
+from .constants import P_VDSM_HOOKS, P_VDSM, P_VDSM_RUN
 
 _LAUNCH_FLAGS_FILE = 'launchflags'
 _LAUNCH_FLAGS_PATH = os.path.join(
@@ -95,8 +95,7 @@
         if vmconf.get('vmId'):
             scriptenv['vmId'] = vmconf.get('vmId')
         ppath = scriptenv.get('PYTHONPATH', '')
-        hook = os.path.join(os.path.dirname(__file__), 'hook')
-        scriptenv['PYTHONPATH'] = ':'.join(ppath.split(':') + [hook])
+        scriptenv['PYTHONPATH'] = ':'.join(ppath.split(':') + [P_VDSM])
         if hookType == _DOMXML_HOOK:
             scriptenv['_hook_domxml'] = data_filename
         elif hookType == _JSON_HOOK:
diff --git a/vdsm.spec.in b/vdsm.spec.in
index 58e7069..25af81f 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -877,6 +877,7 @@
 %dir %{_sysconfdir}/%{vdsm_name}/mom.d
 %dir %{_datadir}/%{vdsm_name}
 %{_datadir}/%{vdsm_name}/daemonAdapter
+%{_datadir}/%{vdsm_name}/hooking.py*
 %{_datadir}/%{vdsm_name}/sitecustomize.py*
 %{_datadir}/%{vdsm_name}/supervdsmd
 %{_datadir}/%{vdsm_name}/vdsmd
@@ -1050,7 +1051,6 @@
 %{python_sitelib}/%{vdsm_name}/cmdutils.py*
 %{python_sitelib}/%{vdsm_name}/commands.py*
 %{python_sitelib}/%{vdsm_name}/common/*.py*
-%{python_sitelib}/%{vdsm_name}/hook/*.py*
 %{python_sitelib}/%{vdsm_name}/host/*.py*
 %{python_sitelib}/%{vdsm_name}/common/network/*.py*
 %{python_sitelib}/%{vdsm_name}/config.py*
diff --git a/vdsm/Makefile.am b/vdsm/Makefile.am
index e264029..53f6e44 100644
--- a/vdsm/Makefile.am
+++ b/vdsm/Makefile.am
@@ -21,6 +21,7 @@
 include $(top_srcdir)/build-aux/Makefile.subs
 
 dist_vdsm_PYTHON = \
+       hooking.py \
        sitecustomize.py \
        $(NULL)
 
diff --git a/lib/vdsm/hook/hooking.py b/vdsm/hooking.py
similarity index 98%
rename from lib/vdsm/hook/hooking.py
rename to vdsm/hooking.py
index d88439b..803231a 100644
--- a/lib/vdsm/hook/hooking.py
+++ b/vdsm/hooking.py
@@ -35,7 +35,6 @@
 2 - the hook failed, no further hooks should be processed.
 >2 - reserved
 """
-from __future__ import absolute_import
 
 from vdsm import hooks
 import json


-- 
To view, visit https://gerrit.ovirt.org/80444
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I383f3c747a45194949a8dca073c93afddda61674
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yaniv Bronhaim <ybron...@redhat.com>
_______________________________________________
vdsm-patches mailing list -- vdsm-patches@lists.fedorahosted.org
To unsubscribe send an email to vdsm-patches-le...@lists.fedorahosted.org

Reply via email to