Change in vdsm[master]: Adding "abrt-cli list" output to sos plugin
by Code Review
From Yaniv Bronhaim <ybronhei(a)redhat.com>:
Yaniv Bronhaim has uploaded a new change for review.
Change subject: Adding "abrt-cli list" output to sos plugin
......................................................................
Adding "abrt-cli list" output to sos plugin
Change-Id: Id0c45c11a441c23551633f3bcb779d476f8da9e5
Signed-off-by: Yaniv Bronhaim <ybronhei(a)redhat.com>
---
M vdsm/sos/vdsm.py.in
1 file changed, 1 insertion(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/16/74416/1
diff --git a/vdsm/sos/vdsm.py.in b/vdsm/sos/vdsm.py.in
index 2225866..c97dcd7 100644
--- a/vdsm/sos/vdsm.py.in
+++ b/vdsm/sos/vdsm.py.in
@@ -130,6 +130,7 @@
self.collectExtOutput("/sbin/iscsiadm -m node")
self.collectExtOutput("/sbin/iscsiadm -m session")
self.collectExtOutput("/usr/sbin/nodectl info")
+ self.collectExtOutput("/usr/bin/abrt-cli list")
try:
cli = client.connect('localhost')
--
To view, visit https://gerrit.ovirt.org/74416
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id0c45c11a441c23551633f3bcb779d476f8da9e5
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yaniv Bronhaim <ybronhei(a)redhat.com>
7 years, 1 month
Change in vdsm[master]: tests: Standard permutations list format
by Code Review
From Dan Kenigsberg <danken(a)redhat.com>:
Dan Kenigsberg has submitted this change and it was merged.
Change subject: tests: Standard permutations list format
......................................................................
tests: Standard permutations list format
Format permutations list so adding or removing a permutation require
modification of a single line and create nicer diffs. This format is
also consistent with most other tests.
Change-Id: I2cdfee4773dd67c02b9436ad04ddfc6ee12a22f1
Signed-off-by: Nir Soffer <nsoffer(a)redhat.com>
---
M tests/moduleloader_test.py
1 file changed, 5 insertions(+), 5 deletions(-)
Approvals:
Piotr Kliczewski: Looks good to me, but someone else must approve
Nir Soffer: Verified
Jenkins CI: Passed CI tests
Dan Kenigsberg: Looks good to me, approved
--
To view, visit https://gerrit.ovirt.org/67344
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I2cdfee4773dd67c02b9436ad04ddfc6ee12a22f1
Gerrit-PatchSet: 5
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Irit Goihman <igoihman(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczewski(a)gmail.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei(a)redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation(a)ovirt.org>
7 years, 1 month
Change in vdsm[master]: Reverting ntp requirement
by Code Review
From Yaniv Bronhaim <ybronhei(a)redhat.com>:
Yaniv Bronhaim has uploaded a new change for review.
Change subject: Reverting ntp requirement
......................................................................
Reverting ntp requirement
This was introduced in https://gerrit.ovirt.org/#/c/903 , the only
leftover is the requirement in spec. The requirement is not needed and
ntp should be configured and maintained by admin
Change-Id: If588265cd7d100ab5d003ba9ec161151ea7dcb16
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1428419
Signed-off-by: Yaniv Bronhaim <ybronhei(a)redhat.com>
---
M vdsm.spec.in
1 file changed, 0 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/22/73822/1
diff --git a/vdsm.spec.in b/vdsm.spec.in
index 608f357..2f9a87c 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -94,7 +94,6 @@
Requires: sudo >= 1.7.3
Requires: logrotate
Requires: xz
-Requires: ntp
Requires: iproute >= 3.10.0
Requires: PyYAML
Requires: python-dateutil
--
To view, visit https://gerrit.ovirt.org/73822
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: If588265cd7d100ab5d003ba9ec161151ea7dcb16
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yaniv Bronhaim <ybronhei(a)redhat.com>
7 years, 1 month
Change in vdsm[master]: tests: Standard permutations list format
by Code Review
From Dan Kenigsberg <danken(a)redhat.com>:
Dan Kenigsberg has posted comments on this change.
Change subject: tests: Standard permutations list format
......................................................................
Patch Set 3: Code-Review+2
--
To view, visit https://gerrit.ovirt.org/67344
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I2cdfee4773dd67c02b9436ad04ddfc6ee12a22f1
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Irit Goihman <igoihman(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczewski(a)gmail.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei(a)redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation(a)ovirt.org>
Gerrit-HasComments: No
7 years, 1 month
Change in vdsm[master]: cmdutils: Fix message format
by Code Review
From Dan Kenigsberg <danken(a)redhat.com>:
Dan Kenigsberg has submitted this change and it was merged.
Change subject: cmdutils: Fix message format
......................................................................
cmdutils: Fix message format
In commit fb57a5a34adf (errors: Use new errors.Base class) I made a typo
on cmdutils.Error msg format string. Raising this error will show now
this error instead of the original error:
Traceback (most recent call last):
File "/home/nsoffer/src/vdsm/tests/cmdutils_test.py", line 119, in test_format
str(cmdutils.Error(["cmd"], 1, "out\n", "err\n"))
File "/home/nsoffer/src/vdsm/lib/vdsm/common/errors.py", line 35, in __str__
return self.msg.format(self=self)
KeyError: 'sef'
This patch fixes the typo and add the missing test for this class.
Change-Id: Ic2348aa107cb09d3db6c9a8875a984b62b76c3ff
Signed-off-by: Nir Soffer <nsoffer(a)redhat.com>
---
M lib/vdsm/cmdutils.py
M tests/cmdutils_test.py
2 files changed, 8 insertions(+), 1 deletion(-)
Approvals:
Nir Soffer: Verified
Jenkins CI: Passed CI tests
Dan Kenigsberg: Looks good to me, approved
--
To view, visit https://gerrit.ovirt.org/74625
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ic2348aa107cb09d3db6c9a8875a984b62b76c3ff
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: Adam Litke <alitke(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation(a)ovirt.org>
7 years, 1 month
Change in vdsm[master]: cmdutils: Fix message format
by Code Review
From Dan Kenigsberg <danken(a)redhat.com>:
Dan Kenigsberg has posted comments on this change.
Change subject: cmdutils: Fix message format
......................................................................
Patch Set 1: Code-Review+2
--
To view, visit https://gerrit.ovirt.org/74625
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Ic2348aa107cb09d3db6c9a8875a984b62b76c3ff
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: Adam Litke <alitke(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation(a)ovirt.org>
Gerrit-HasComments: No
7 years, 1 month
Change in vdsm[master]: [WIP]ABRT integration
by ykaplan@redhat.com
Yeela Kaplan has uploaded a new change for review.
Change subject: [WIP]ABRT integration
......................................................................
[WIP]ABRT integration
Change-Id: I1ca5e66c9f029be75483b86414e328d074c7e454
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=917062
Signed-off-by: Yeela Kaplan <ykaplan(a)redhat.com>
---
M init/systemd/vdsmd.service.in
M init/vdsmd_init_common.sh.in
M lib/vdsm/tool/configurators/Makefile.am
A lib/vdsm/tool/configurators/abrt.py
M vdsm.spec.in
M vdsm/vdsm-logrotate
6 files changed, 138 insertions(+), 28 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/87/44287/1
diff --git a/init/systemd/vdsmd.service.in b/init/systemd/vdsmd.service.in
index d7d025f..ccacb2e 100644
--- a/init/systemd/vdsmd.service.in
+++ b/init/systemd/vdsmd.service.in
@@ -2,9 +2,10 @@
Description=Virtual Desktop Server Manager
Requires=multipathd.service libvirtd.service time-sync.target \
iscsid.service rpcbind.service supervdsmd.service sanlock.service \
- vdsm-network.service
+ vdsm-network.service abrtd.service
After=multipathd.service libvirtd.service iscsid.service rpcbind.service \
- supervdsmd.service sanlock.service vdsm-network.service
+ supervdsmd.service sanlock.service vdsm-network.service \
+ abrtd.service
Conflicts=libvirt-guests.service
Wants=mom-vdsm.service
diff --git a/init/vdsmd_init_common.sh.in b/init/vdsmd_init_common.sh.in
index 00e4054..df2878c 100644
--- a/init/vdsmd_init_common.sh.in
+++ b/init/vdsmd_init_common.sh.in
@@ -83,16 +83,6 @@
return 0
}
-task_configure_coredump() {
- local conf_file="@CONFDIR(a)/vdsm.conf"
- local getconfitem="@VDSMDIR@/get-conf-item"
-
- if "${getconfitem}" "${conf_file}" vars core_dump_enable false |
- tr A-Z a-z | grep -q true; then
- echo "/var/log/core/core.%p.%t.dump" > /proc/sys/kernel/core_pattern
- fi
-}
-
task_configure_vdsm_logs() {
local vdsm_logs="
@VDSMLOGDIR(a)/connectivity.log
@@ -296,7 +286,6 @@
--pre-start)
run_tasks " \
mkdirs \
- configure_coredump \
configure_vdsm_logs \
wait_for_network \
run_init_hooks \
diff --git a/lib/vdsm/tool/configurators/Makefile.am b/lib/vdsm/tool/configurators/Makefile.am
index 9fc7e57..f70b4bb 100644
--- a/lib/vdsm/tool/configurators/Makefile.am
+++ b/lib/vdsm/tool/configurators/Makefile.am
@@ -21,6 +21,7 @@
dist_configurators_PYTHON = \
__init__.py \
+ abrt.py \
certificates.py \
libvirt.py \
multipath.py \
diff --git a/lib/vdsm/tool/configurators/abrt.py b/lib/vdsm/tool/configurators/abrt.py
new file mode 100644
index 0000000..778f505
--- /dev/null
+++ b/lib/vdsm/tool/configurators/abrt.py
@@ -0,0 +1,132 @@
+# Copyright 2015 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
+#
+
+import sys
+import os
+
+from .import \
+ MAYBE, \
+ NO
+from .. import service
+from ... import utils
+from ... import constants
+
+from .. import conf_utils
+
+CONF_VERSION = '4.17.0'
+
+
+services = ("abrtd",)
+
+
+def configure():
+
+ conf_utils.remove_conf(FILES, CONF_VERSION)
+
+ for conf_file, content in FILES.items():
+ content['configure'](content, CONF_VERSION)
+
+
+def isconfigured():
+ """
+ Check if abrt is already configured for vdsm
+ """
+ ret = MAYBE
+
+ for path in (conf_utils.get_persisted_files(FILES)):
+ if not conf_utils.open_config(path, CONF_VERSION).hasConf():
+ ret = NO
+
+ if ret == MAYBE:
+ sys.stdout.write("abrt is already configured for vdsm\n")
+ else:
+ sys.stdout.write("abrt is not configured for vdsm\n")
+ return ret
+
+
+FILES = {
+ 'ABRT_CONF': {
+ 'path': os.path.join(
+ constants.SYSCONF_PATH,
+ 'abrt/abrt.conf'
+ ),
+ 'configure': conf_utils.add_section,
+ 'removeConf': conf_utils.remove_section,
+ 'persisted': True,
+ 'fragments': [
+ {
+ 'conditions': {},
+ 'content': {
+ 'DumpLocation': '/var/tmp/abrt'
+ },
+ },
+ ]
+ },
+ 'CCPP_CONF': {
+ 'path': os.path.join(
+ constants.SYSCONF_PATH,
+ 'abrt/plugins/CCpp.conf'
+ ),
+ 'configure': conf_utils.add_section,
+ 'removeConf': conf_utils.remove_section,
+ 'persisted': True,
+ 'fragments': [
+ {
+ 'conditions': {},
+ 'content': {
+ 'Backtrace': 'yes'
+ },
+ },
+ ]
+ },
+ 'PYTHON_CONF': {
+ 'path': os.path.join(
+ constants.SYSCONF_PATH,
+ 'abrt/plugins/python.conf'
+ ),
+ 'configure': conf_utils.add_section,
+ 'removeConf': conf_utils.remove_section,
+ 'persisted': True,
+ 'fragments': [
+ {
+ 'conditions': {},
+ 'content': {
+ 'Backtrace': 'yes'
+ },
+ },
+ ]
+ },
+ 'PKG_CONF': {
+ 'path': os.path.join(
+ constants.SYSCONF_PATH,
+ 'abrt/abrt-action-save-package-data.conf'
+ ),
+ 'configure': conf_utils.add_section,
+ 'removeConf': conf_utils.remove_section,
+ 'persisted': True,
+ 'fragments': [
+ {
+ 'conditions': {},
+ 'content': {
+ 'openGPGCheck': 'no'
+ },
+ },
+ ]
+ }
+}
diff --git a/vdsm.spec.in b/vdsm.spec.in
index 21e1b50..6e524c5 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -132,6 +132,7 @@
Requires: nfs-utils
Requires: m2crypto
Requires: libnl3
+Requires: abrt-desktop
Requires: curl
Requires: %{name}-xmlrpc = %{version}-%{release}
Requires: %{name}-jsonrpc = %{version}-%{release}
@@ -709,13 +710,6 @@
/etc/sysctl.conf
fi
-# hack until we replace core dump with abrt
-if /usr/sbin/selinuxenabled; then
- /usr/sbin/semanage fcontext -a -t virt_cache_t '/var/log/core(/.*)?'
-fi
-/sbin/restorecon -R /var/log/core >/dev/null 2>&1
-# hack until we replace core dump with abrt
-
# VDSM installs vdsm-modules-load.d.conf file - the following command will
# refresh vdsm kernel modules requirements to start on boot
/bin/systemctl restart systemd-modules-load.service >/dev/null 2>&1 || :
@@ -1097,6 +1091,7 @@
%{python_sitelib}/%{vdsm_name}/tool/conf_utils.py*
%{python_sitelib}/%{vdsm_name}/tool/configurator.py*
%{python_sitelib}/%{vdsm_name}/tool/configurators/__init__*
+%{python_sitelib}/%{vdsm_name}/tool/configurators/abrt.py*
%{python_sitelib}/%{vdsm_name}/tool/configurators/certificates.py*
%{python_sitelib}/%{vdsm_name}/tool/configurators/libvirt.py*
%{python_sitelib}/%{vdsm_name}/tool/configurators/passwd.py*
diff --git a/vdsm/vdsm-logrotate b/vdsm/vdsm-logrotate
index e2027ac..17d26ab 100755
--- a/vdsm/vdsm-logrotate
+++ b/vdsm/vdsm-logrotate
@@ -7,12 +7,4 @@
/usr/bin/logger -t logrotate "ALERT exited abnormally with [$EXITVALUE]"
fi
-if [ -d /var/log/core ] ; then
- /usr/bin/find /var/log/core -type f -name '*xz' -mtime +7 -exec /bin/rm -f '{}' \;
- EXITVALUE=$?
- if [ $EXITVALUE != 0 ]; then
- /usr/bin/logger -t logrotate "ALERT clean old core files exited abnormally with [$EXITVALUE]"
- fi
-fi
-
exit $EXITVALUE
--
To view, visit https://gerrit.ovirt.org/44287
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I1ca5e66c9f029be75483b86414e328d074c7e454
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yeela Kaplan <ykaplan(a)redhat.com>
7 years, 1 month
Change in vdsm[master]: [WIP]configurators: move configurator functions into conf_utils
by ykaplan@redhat.com
Yeela Kaplan has uploaded a new change for review.
Change subject: [WIP]configurators: move configurator functions into conf_utils
......................................................................
[WIP]configurators: move configurator functions into conf_utils
Change-Id: Id67a0f51adb2d543c0542a48c020d34a13d1f2ed
Signed-off-by: Yeela Kaplan <ykaplan(a)redhat.com>
---
M lib/vdsm/tool/Makefile.am
A lib/vdsm/tool/conf_utils.py
M vdsm.spec.in
3 files changed, 110 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/86/44286/1
diff --git a/lib/vdsm/tool/Makefile.am b/lib/vdsm/tool/Makefile.am
index c8979ca..c3ed0cc 100644
--- a/lib/vdsm/tool/Makefile.am
+++ b/lib/vdsm/tool/Makefile.am
@@ -35,7 +35,8 @@
dump_bonding_defaults.py \
dump_volume_chains.py \
nwfilter.py \
- configfile.py \
+ conf_utils.py \
+ configfile.py \
configurator.py \
register.py \
restore_nets.py \
diff --git a/lib/vdsm/tool/conf_utils.py b/lib/vdsm/tool/conf_utils.py
new file mode 100644
index 0000000..1308097
--- /dev/null
+++ b/lib/vdsm/tool/conf_utils.py
@@ -0,0 +1,107 @@
+# Copyright 2015 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
+#
+import os
+
+from .. configfile import (
+ ConfigFile,
+)
+
+from ... import utils
+
+if utils.isOvirtNode():
+ from ovirt.node.utils.fs import Config as NodeCfg
+
+
+def get_file(fname, files):
+ return files[fname]['path']
+
+
+def remove_conf(files, version):
+ for cfile, content in files.items():
+ content['removeConf'](content['path'], version)
+
+
+def add_section(content, version, vdsmConfiguration={}):
+ """
+ Add a 'configuration section by vdsm' part to a config file.
+ This section contains only keys not originally defined
+ The section headers will include the current configuration version.
+ """
+ configuration = {}
+ for fragment in content['fragments']:
+ if vdsmConfiguration:
+ if is_applicable(fragment, vdsmConfiguration):
+ configuration.update(fragment['content'])
+ else:
+ configuration.update(fragment['content'])
+ if configuration:
+ with open_config(content['path'], version) as conff:
+ for key, val in configuration.items():
+ conff.addEntry(key, val)
+
+
+def remove_section(path, version):
+ """
+ remove entire 'configuration section by vdsm' section.
+ section is removed regardless of it's version.
+ """
+ if os.path.exists(path):
+ with open_config(path, version) as conff:
+ conff.removeConf()
+
+
+def remove_file(content, vdsmConfiguration):
+ """
+ delete a file if it exists.
+ """
+ if utils.isOvirtNode():
+ NodeCfg().delete(content['path'])
+ else:
+ try:
+ os.unlink(content['path'])
+ except OSError as e:
+ if e.errno != errno.ENOENT:
+ raise
+
+
+def get_persisted_files(files):
+ """
+ get files where vdsm is expected to add a section.
+ """
+ return [
+ cfile['path'] for cfile in files.values()
+ if cfile['persisted']
+ ]
+
+
+def open_config(path, conf_version):
+ return ConfigFile(path, conf_version)
+
+
+def is_applicable(fragment, vdsmConfiguration):
+ """
+ Return true if 'fragment' should be included for current
+ configuration. An applicable fragment is a fragment who's list
+ of conditions are met according to vdsmConfiguration.
+ """
+ applyFragment = True
+ for key, booleanValue in fragment['conditions'].items():
+ if vdsmConfiguration[key] != booleanValue:
+ applyFragment = False
+ return applyFragment
diff --git a/vdsm.spec.in b/vdsm.spec.in
index 5020d8b..21e1b50 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -1094,6 +1094,7 @@
%{python_sitelib}/%{vdsm_name}/tool/dummybr.py*
%{python_sitelib}/%{vdsm_name}/tool/dump_bonding_defaults.py*
%{python_sitelib}/%{vdsm_name}/tool/nwfilter.py*
+%{python_sitelib}/%{vdsm_name}/tool/conf_utils.py*
%{python_sitelib}/%{vdsm_name}/tool/configurator.py*
%{python_sitelib}/%{vdsm_name}/tool/configurators/__init__*
%{python_sitelib}/%{vdsm_name}/tool/configurators/certificates.py*
--
To view, visit https://gerrit.ovirt.org/44286
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id67a0f51adb2d543c0542a48c020d34a13d1f2ed
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yeela Kaplan <ykaplan(a)redhat.com>
7 years, 1 month
Change in vdsm[master]: configfile: remove old configuration when attribute is set
by Code Review
From Yaniv Bronhaim <ybronhei(a)redhat.com>:
Yaniv Bronhaim has uploaded a new change for review.
Change subject: configfile: remove old configuration when attribute is set
......................................................................
configfile: remove old configuration when attribute is set
When vdsm configures a key that already exists in conf file, the new key
will be created in vdsm-config-section and won't be copied from the
original file. oldentries is a variable that tried to do the opposite
and leave keys instead of overriding with vdsm conf - the intention
should be to use vdsm configuration after calling vdsm-tool configure
Change-Id: Id1dba75449b712432e0c2bc5b128cc996ede0153
Signed-off-by: Yaniv Bronhaim <ybronhei(a)redhat.com>
---
M lib/vdsm/tool/configfile.py
M tests/tool_test.py
2 files changed, 30 insertions(+), 14 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/31/74331/1
diff --git a/lib/vdsm/tool/configfile.py b/lib/vdsm/tool/configfile.py
index bad0759..1c2076f 100644
--- a/lib/vdsm/tool/configfile.py
+++ b/lib/vdsm/tool/configfile.py
@@ -21,7 +21,6 @@
import functools
import os
import tempfile
-import re
import selinux
from six.moves import configparser
import io
@@ -112,9 +111,7 @@
return self
def _getOldContent(self):
- confpat = re.compile(r'^\s*(?P<key>[^=\s#]*)\s*=')
oldlines = []
- oldentries = set()
with io.open(self._filename, 'r', encoding='utf8') as f:
for line in f:
if self._remove:
@@ -135,13 +132,10 @@
line = line[len(self._prefix):]
if self._prefixAdd:
line = self._prefix + line
- m = confpat.match(line.rstrip())
- if m:
- oldentries.add(m.group('key'))
# remove this if at 4.0. see 'Backward compatibility'
if not self._remove or self._lineComment not in line:
oldlines.append(line)
- return oldlines, oldentries
+ return oldlines
def _start(self):
return u"%s-%s\n" % (self._sectionStart, self._version)
@@ -154,26 +148,28 @@
f.write(self._section)
f.write(self._end())
- def _writeEntries(self, f, oldentries):
+ def _writeEntries(self, f):
f.write(self._start())
for key, val in sorted(self._entries.items()):
- if key not in oldentries:
- f.write(u"{k}={v}\n".format(k=key, v=val))
+ f.write(u"{k}={v}\n".format(k=key, v=val))
f.write(self._end())
def __exit__(self, exec_ty, exec_val, tb):
-
self._context = False
if exec_ty is None:
fd, tname = tempfile.mkstemp(dir=os.path.dirname(self._filename))
try:
- oldlines, oldentries = self._getOldContent()
+ oldlines = self._getOldContent()
with io.open(fd, 'w', encoding='utf8') as f:
if self._section:
self._writeSection(f)
- f.writelines(oldlines)
+ # if oldlines includes something that we have in
+ # self._entries we need to write only the new value!
+ for line in oldlines:
+ if line.split("=")[0] not in self._entries:
+ f.write(line)
if self._entries:
- self._writeEntries(f, oldentries)
+ self._writeEntries(f)
os.rename(tname, self._filename)
diff --git a/tests/tool_test.py b/tests/tool_test.py
index 828f5ca..1051398 100644
--- a/tests/tool_test.py
+++ b/tests/tool_test.py
@@ -446,6 +446,25 @@
def testAddExistingConf(self):
self._writeConf("key1=val1\n"
+ "key2=val2\n"
+ "#key3=val4")
+ with ConfigFile(self.tname,
+ version='3.4.4',
+ sectionStart="# start conf",
+ sectionEnd="# end conf") as conf:
+ conf.addEntry("key3", "val3")
+ conf.addEntry("key2", "val3")
+
+ with open(self.tname, 'r') as f:
+ self.assertEqual(f.read(), "key1=val1\n"
+ "#key3=val4"
+ "# start conf-3.4.4\n"
+ "key2=val3\n"
+ "key3=val3\n"
+ "# end conf-3.4.4\n")
+
+ def testAddExistingConfWithWhitespaces(self):
+ self._writeConf("key1=val1\n"
" key2 =val2\n"
"#key3=val4")
with ConfigFile(self.tname,
@@ -460,6 +479,7 @@
" key2 =val2\n"
"#key3=val4"
"# start conf-3.4.4\n"
+ "key2=val3\n"
"key3=val3\n"
"# end conf-3.4.4\n")
--
To view, visit https://gerrit.ovirt.org/74331
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id1dba75449b712432e0c2bc5b128cc996ede0153
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yaniv Bronhaim <ybronhei(a)redhat.com>
7 years, 1 month
Change in vdsm[master]: iscsi: Fix useless info log
by Code Review
From Dan Kenigsberg <danken(a)redhat.com>:
Dan Kenigsberg has submitted this change and it was merged.
Change subject: iscsi: Fix useless info log
......................................................................
iscsi: Fix useless info log
We use to log this useless log in INFO level:
[storage.ISCSI] iSCSI iface.net_ifacename not provided. Skipping. (iscsi:590)
The log was replace with this, and moved to DEBUG level:
[storage.ISCSI] iface.net_ifacename not provided, skipping rp filter setup (iscsi:590)
Change-Id: I909187d8058050ae040103a04fd0a5226b114a50
Signed-off-by: Nir Soffer <nsoffer(a)redhat.com>
---
M lib/vdsm/storage/iscsi.py
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
Nir Soffer: Verified
Jenkins CI: Passed CI tests
Dan Kenigsberg: Looks good to me, approved
--
To view, visit https://gerrit.ovirt.org/74589
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I909187d8058050ae040103a04fd0a5226b114a50
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: Adam Litke <alitke(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation(a)ovirt.org>
7 years, 1 month