From Dan Kenigsberg <danken(a)redhat.com>:
Dan Kenigsberg has uploaded a new change for review.
Change subject: introduce common.constants
......................................................................
introduce common.constants
Several constants are used by all vdsm subsystems. This patch itroduces
common.constants to host them. I do not simply move vdsm.constants into
vdsm.common.constants in order to scrutinize better which constants are
placed in common.
Change-Id: I8568a806f9195007620d15eff59e72b55042557b
Signed-off-by: Dan Kenigsberg <danken(a)redhat.com>
---
M .gitignore
M lib/vdsm/common/Makefile.am
A lib/vdsm/common/constants.py.in
M lib/vdsm/constants.py.in
4 files changed, 40 insertions(+), 4 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/92/79692/1
diff --git a/.gitignore b/.gitignore
index e334131..7786c6c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -27,6 +27,7 @@
init/systemd/vdsm-tmpfiles.d.conf
init/vdsmd_init_common.sh
lib/vdsm/api/vdsm-api.html
+lib/vdsm/common/constants.py
lib/vdsm/config.py
lib/vdsm/constants.py
lib/vdsm/dsaversion.py
diff --git a/lib/vdsm/common/Makefile.am b/lib/vdsm/common/Makefile.am
index a7ed5da..447e4e8 100644
--- a/lib/vdsm/common/Makefile.am
+++ b/lib/vdsm/common/Makefile.am
@@ -21,4 +21,13 @@
SUBDIRS = network
vdsmcommondir = $(vdsmpylibdir)/common
+
+nodist_vdsmcommon_PYTHON = \
+ constants.py \
+ $(NULL)
+
dist_vdsmcommon_PYTHON = *.py
+
+EXTRA_DIST = \
+ constants.py.in \
+ $(NULL)
diff --git a/lib/vdsm/common/constants.py.in b/lib/vdsm/common/constants.py.in
new file mode 100644
index 0000000..e657f06
--- /dev/null
+++ b/lib/vdsm/common/constants.py.in
@@ -0,0 +1,26 @@
+#
+# Copyright 2009-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
+
+P_VDSM = '@VDSMDIR@/' # NOQA: E501 (potentially long line)
+P_VDSM_HOOKS = '@HOOKSDIR@/' # NOQA: E501 (potentially long line)
+P_VDSM_LIB = '@VDSMLIBDIR@/' # NOQA: E501 (potentially long line)
+P_VDSM_RUN = '@VDSMRUNDIR@/' # NOQA: E501 (potentially long line)
diff --git a/lib/vdsm/constants.py.in b/lib/vdsm/constants.py.in
index 32c87d9..7b2a055 100644
--- a/lib/vdsm/constants.py.in
+++ b/lib/vdsm/constants.py.in
@@ -23,6 +23,10 @@
from __future__ import absolute_import
import os
+from vdsm.common.constants import ( # NOQA: F401 (intentionally exposed here)
+ P_VDSM, P_VDSM_HOOKS, P_VDSM_LIB,
+ P_VDSM_RUN)
+
GLUSTER_MGMT_ENABLED = bool(@GLUSTER_MGMT@)
# SMBIOS manufacturer
@@ -72,10 +76,6 @@
#
P_LIBVIRT_VMCHANNELS = '/var/lib/libvirt/qemu/channels/'
P_OVIRT_VMCONSOLES = '/var/run/ovirt-vmconsole-console/'
-P_VDSM = '@VDSMDIR@/' # NOQA: E501 (potentially long line)
-P_VDSM_HOOKS = '@HOOKSDIR@/' # NOQA: E501 (potentially long line)
-P_VDSM_LIB = '@VDSMLIBDIR@/' # NOQA: E501 (potentially long line)
-P_VDSM_RUN = '@VDSMRUNDIR@/' # NOQA: E501 (potentially long line)
P_VDSM_STORAGE = os.path.join(P_VDSM_RUN, 'storage/')
P_VDSM_CONF = '@CONFDIR@/' # NOQA: E501 (potentially long line)
P_VDSM_KEYS = '/etc/pki/vdsm/keys/'
--
To view, visit
https://gerrit.ovirt.org/79692
To unsubscribe, visit
https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I8568a806f9195007620d15eff59e72b55042557b
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Dan Kenigsberg <danken(a)redhat.com>