From 6a24672eb14829fed18c166702a144a1fd95df8d Mon Sep 17 00:00:00 2001 From: slin14 Date: Wed, 26 Sep 2018 19:35:21 +0800 Subject: [PATCH 1/9] rebase e1000e driver patch from 3.4.1.1 to 3.4.2.1 version Story: 2003597 Task: 24918 Depends-On: https://review.openstack.org/605287 Change-Id: Ia1e38033424e15776f96b0f9155c0758e3835c14 Signed-off-by: slin14 --- kernel/kernel-modules/intel-e1000e/centos/build_srpm.data | 2 +- kernel/kernel-modules/intel-e1000e/centos/e1000e-kmod.spec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/kernel-modules/intel-e1000e/centos/build_srpm.data b/kernel/kernel-modules/intel-e1000e/centos/build_srpm.data index 107fd4aa6..ea6ffa8c8 100644 --- a/kernel/kernel-modules/intel-e1000e/centos/build_srpm.data +++ b/kernel/kernel-modules/intel-e1000e/centos/build_srpm.data @@ -1,4 +1,4 @@ COPY_LIST=" \ $PKG_BASE/files/* \ - $STX_BASE/downloads/e1000e-3.4.1.1.tar.gz" + $STX_BASE/downloads/e1000e-3.4.2.1.tar.gz" TIS_PATCH_VER=1 diff --git a/kernel/kernel-modules/intel-e1000e/centos/e1000e-kmod.spec b/kernel/kernel-modules/intel-e1000e/centos/e1000e-kmod.spec index 65d1e6196..a3985e7de 100644 --- a/kernel/kernel-modules/intel-e1000e/centos/e1000e-kmod.spec +++ b/kernel/kernel-modules/intel-e1000e/centos/e1000e-kmod.spec @@ -8,7 +8,7 @@ %define kmod_name e1000e Name: %{kmod_name}-kmod%{?bt_ext} -Version: 3.4.1.1 +Version: 3.4.2.1 Release: 0%{?_tis_dist}.%{tis_patch_ver} Group: System Environment/Kernel License: GPLv2 From c658f53d02ba5e8b8234999811d37ed778e3dcbf Mon Sep 17 00:00:00 2001 From: zhipengl Date: Fri, 7 Dec 2018 19:32:34 +0800 Subject: [PATCH 2/9] Refactor motd patch for crontabs According to analysis from Saul in task 26455, we can remove motd patch for crontabs and then use RPM instead of SRPM for it. We also need to remove usage of --without-progname in utilities/ update-motd/files/motd-update. Story: 2003765 Task: 28181 & 28182 Depends-on: https://review.openstack.org/#/c/623385/ Change-Id: I4be7d47ee77ac07eb24f5b88cd707c29b595df7a Signed-off-by: zhipengl --- base/crontabs/centos/build_srpm.data | 1 - ...te-package-versioning-for-TIS-format.patch | 25 ------- base/crontabs/centos/meta_patches/PATCH_ORDER | 2 - ...o-remove-printing-of-motd-script-nam.patch | 35 ---------- ...tion-to-remove-printing-of-motd-scri.patch | 65 ------------------- base/crontabs/centos/srpm_path | 1 - centos_pkg_dirs | 1 - utilities/update-motd/files/motd-update | 2 +- 8 files changed, 1 insertion(+), 131 deletions(-) delete mode 100644 base/crontabs/centos/build_srpm.data delete mode 100644 base/crontabs/centos/meta_patches/0001-Update-package-versioning-for-TIS-format.patch delete mode 100644 base/crontabs/centos/meta_patches/PATCH_ORDER delete mode 100644 base/crontabs/centos/meta_patches/spec-add-patch-to-remove-printing-of-motd-script-nam.patch delete mode 100644 base/crontabs/centos/patches/run-parts-add-option-to-remove-printing-of-motd-scri.patch delete mode 100644 base/crontabs/centos/srpm_path diff --git a/base/crontabs/centos/build_srpm.data b/base/crontabs/centos/build_srpm.data deleted file mode 100644 index 70b4b5dcb..000000000 --- a/base/crontabs/centos/build_srpm.data +++ /dev/null @@ -1 +0,0 @@ -TIS_PATCH_VER=2 diff --git a/base/crontabs/centos/meta_patches/0001-Update-package-versioning-for-TIS-format.patch b/base/crontabs/centos/meta_patches/0001-Update-package-versioning-for-TIS-format.patch deleted file mode 100644 index 8f3d7f6b3..000000000 --- a/base/crontabs/centos/meta_patches/0001-Update-package-versioning-for-TIS-format.patch +++ /dev/null @@ -1,25 +0,0 @@ -From a15d83975ed19367767e18354ea07cd5d281e265 Mon Sep 17 00:00:00 2001 -From: Don Penney -Date: Tue, 27 Sep 2016 10:14:02 -0400 -Subject: [PATCH] Update package versioning for TIS format - ---- - SPECS/crontabs.spec | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/SPECS/crontabs.spec b/SPECS/crontabs.spec -index 7001d1a..4512bcc 100644 ---- a/SPECS/crontabs.spec -+++ b/SPECS/crontabs.spec -@@ -2,7 +2,7 @@ - Summary: Root crontab files used to schedule the execution of programs - Name: crontabs - Version: 1.11 --Release: 6.%{snap_release}%{?dist} -+Release: 6.%{snap_release}.el7%{?_tis_dist}.%{tis_patch_ver} - License: Public Domain and GPLv2 - Group: System Environment/Base - URL: https://fedorahosted.org/crontabs --- -1.8.3.1 - diff --git a/base/crontabs/centos/meta_patches/PATCH_ORDER b/base/crontabs/centos/meta_patches/PATCH_ORDER deleted file mode 100644 index 253c79ab1..000000000 --- a/base/crontabs/centos/meta_patches/PATCH_ORDER +++ /dev/null @@ -1,2 +0,0 @@ -spec-add-patch-to-remove-printing-of-motd-script-nam.patch -0001-Update-package-versioning-for-TIS-format.patch diff --git a/base/crontabs/centos/meta_patches/spec-add-patch-to-remove-printing-of-motd-script-nam.patch b/base/crontabs/centos/meta_patches/spec-add-patch-to-remove-printing-of-motd-script-nam.patch deleted file mode 100644 index 5c61ad948..000000000 --- a/base/crontabs/centos/meta_patches/spec-add-patch-to-remove-printing-of-motd-script-nam.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 9221bd11aec1590df2dc3f19e9a582d76ed7adc0 Mon Sep 17 00:00:00 2001 -From: Michel Thebeau -Date: Mon, 25 Jul 2016 11:45:55 -0400 -Subject: [PATCH] spec: add patch to remove printing of motd script name - -Signed-off-by: Michel Thebeau ---- - SPECS/crontabs.spec | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/SPECS/crontabs.spec b/SPECS/crontabs.spec -index d6a8c69..90098e1 100644 ---- a/SPECS/crontabs.spec -+++ b/SPECS/crontabs.spec -@@ -10,6 +10,8 @@ Source0: https://fedorahosted.org/releases/c/r/crontabs/%{name}-%{version}-1.%{s - BuildArch: noarch - Requires: /etc/cron.d - -+Patch1: run-parts-add-option-to-remove-printing-of-motd-scri.patch -+ - %description - This package is used by Fedora mainly for executing files by cron. - -@@ -25,6 +27,8 @@ your system. - %prep - %setup -q - -+%patch1 -p1 -+ - %build - #empty - --- -1.8.3.1 - diff --git a/base/crontabs/centos/patches/run-parts-add-option-to-remove-printing-of-motd-scri.patch b/base/crontabs/centos/patches/run-parts-add-option-to-remove-printing-of-motd-scri.patch deleted file mode 100644 index ffabb92c5..000000000 --- a/base/crontabs/centos/patches/run-parts-add-option-to-remove-printing-of-motd-scri.patch +++ /dev/null @@ -1,65 +0,0 @@ -From f0bd54cb83ba430ef81153c7a6da2a52daca5266 Mon Sep 17 00:00:00 2001 -From: Michel Thebeau -Date: Mon, 25 Jul 2016 11:23:18 -0400 -Subject: [PATCH] run-parts: add option to remove printing of motd script name - -The awk statement seems to be a round-about way of printing the name of -the motd script (/etc/motd.d/*). The pipe seems to allow awk to print -without user input; while the end of input causes awk to exit. Any -input to awk is echoed to terminal before the motd script name is -printed. - -The script name that is printed is appended to /etc/motd. This is -undesirable. Add an option to skip the awk program. - -Signed-off-by: Michel Thebeau ---- - run-parts | 25 +++++++++++++++++++------ - 1 file changed, 19 insertions(+), 6 deletions(-) - -diff --git a/run-parts b/run-parts -index 7e148f8..b444f4e 100755 ---- a/run-parts -+++ b/run-parts -@@ -4,6 +4,14 @@ - # keep going when something fails - set +e - -+# First parameter to remove printing of the names of executed scripts. -+# The default is unmodified behaviour, print the name of scripts. -+with_progname="y" -+if [ "$1" == "--without-progname" ]; then -+ with_progname="" -+ shift -+fi -+ - if [ $# -lt 1 ]; then - echo "Usage: run-parts [--list | --test] " - exit 1 -@@ -87,12 +95,17 @@ for i in $(LC_ALL=C; echo ${1%/}/*[^~,]) ; do - - # run executable files - logger -p cron.notice -t "run-parts($1)[$$]" "starting $(basename $i)" -- $i 2>&1 | awk -v "progname=$i" \ -- 'progname { -- print progname ":\n" -- progname=""; -- } -- { print; }' -+ if [ -n "$with_progname" ]; then -+ $i 2>&1 | awk -v "progname=$i" \ -+ 'progname { -+ print progname ":\n" -+ progname=""; -+ } -+ { print; }' -+ else -+ $i 2>&1 -+ fi -+ - logger -i -p cron.notice -t "run-parts($1)" "finished $(basename $i)" - fi - fi --- -1.8.3.1 - diff --git a/base/crontabs/centos/srpm_path b/base/crontabs/centos/srpm_path deleted file mode 100644 index 0f0dfed39..000000000 --- a/base/crontabs/centos/srpm_path +++ /dev/null @@ -1 +0,0 @@ -mirror:Source/crontabs-1.11-6.20121102git.el7.src.rpm diff --git a/centos_pkg_dirs b/centos_pkg_dirs index cc99a7c57..e2cceddb7 100644 --- a/centos_pkg_dirs +++ b/centos_pkg_dirs @@ -142,7 +142,6 @@ networking/net-tools filesystem/drbd/drbd-tools database/mariadb database/python-psycopg2 -base/crontabs base/dnsmasq base/dnsmasq-config filesystem/parted diff --git a/utilities/update-motd/files/motd-update b/utilities/update-motd/files/motd-update index b853b09d8..e339e448e 100644 --- a/utilities/update-motd/files/motd-update +++ b/utilities/update-motd/files/motd-update @@ -11,5 +11,5 @@ MOTD_PATH=${MOTD_PATH:-"/etc/motd.d"} MOTD_TAG=${MOTD_TAG:-"motd-update"} if [ -d ${MOTD_PATH} ]; then - run-parts --without-progname ${MOTD_PATH} 1>${MOTD_FILE} + run-parts ${MOTD_PATH} 1>${MOTD_FILE} fi From 38613cac9478ddc129e99e2a645852a2d56b4c71 Mon Sep 17 00:00:00 2001 From: Jason McKenna Date: Fri, 14 Dec 2018 10:33:51 -0500 Subject: [PATCH 3/9] Add go "dep" tool to support lockfiles in go pkgs The go compiler supports "go get" to download dependencies, but it will download the latest version of dependencies from the git repository of the dependency. This could lead to non-reproducable builds, or the potential of dependency API changes (including deprecated features) to break the build of packages. The "dep" tool allows for a lockfile to be created, which captures the git commit ID of dependencies, and can restore dependencies to the captured state. Since no binary package containing "dep" is currently available for CentOS, this change adds the package and compiles it from source. Depends-On: https://review.openstack.org/625333 Story: 2004617 Task: 28525 Change-Id: Ic3bfad6a419b344e7c147c3839d16956c432a99e Signed-off-by: Jason McKenna --- base/golang-dep/centos/build_srpm.data | 2 ++ base/golang-dep/centos/golang-dep.spec | 45 ++++++++++++++++++++++++++ centos_pkg_dirs | 1 + 3 files changed, 48 insertions(+) create mode 100644 base/golang-dep/centos/build_srpm.data create mode 100644 base/golang-dep/centos/golang-dep.spec diff --git a/base/golang-dep/centos/build_srpm.data b/base/golang-dep/centos/build_srpm.data new file mode 100644 index 000000000..418ca079f --- /dev/null +++ b/base/golang-dep/centos/build_srpm.data @@ -0,0 +1,2 @@ +COPY_LIST="$CGCS_BASE/downloads/dep-v0.5.0.tar.gz" +TIS_PATCH_VER=0 diff --git a/base/golang-dep/centos/golang-dep.spec b/base/golang-dep/centos/golang-dep.spec new file mode 100644 index 000000000..ba461d4f8 --- /dev/null +++ b/base/golang-dep/centos/golang-dep.spec @@ -0,0 +1,45 @@ +Name: golang-dep +Version: 0.5.0 +Release: %{tis_patch_ver}%{?_tis_dist} +Summary: Go dep dependency management tool +Group: Development/Languages +License: Go +URL: https://github.com/golang/dep +Source: dep-v0.5.0.tar.gz +BuildRequires: golang +Requires: golang + +%global with_debug 0 +%global debug_package %{nil} +%define __spec_install_post %{nil} + +%define tooldir %{_libdir}/go/pkg/%{name}/linux_amd64 + +%if ! 0%{?gobuild:1} +%define gobuild(o:) go build -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n')" -a -v -x %{?**}; +%endif + +%description +This package includes additional go development tools. + +%prep +%setup -T -c -n go/src/github.com/golang/dep +tar --strip-components=1 -x -f %{SOURCE0} + +%build +export GOPATH=%{_builddir}/go +(cd cmd/dep && %gobuild -o dep) + +%install +rm -rf %{buildroot} +install -d %{buildroot}%{_bindir} +install -d %{buildroot}%{tooldir} +install cmd/dep/dep %{buildroot}%{_bindir} + +%clean +rm -rf %{buildroot} + +%files +%defattr(-,root,root,-) +%{_bindir}/dep + diff --git a/centos_pkg_dirs b/centos_pkg_dirs index cc99a7c57..384080369 100644 --- a/centos_pkg_dirs +++ b/centos_pkg_dirs @@ -145,6 +145,7 @@ database/python-psycopg2 base/crontabs base/dnsmasq base/dnsmasq-config +base/golang-dep filesystem/parted security/python-keyring grub/grub2 From bbd655d23c92d3b4f3473a8f05465c99aa53aaab Mon Sep 17 00:00:00 2001 From: Changcheng Liu Date: Thu, 20 Dec 2018 10:27:34 +0800 Subject: [PATCH 4/9] typo fix: check right dir before starting ceph-manager It should be "/proc" instead of "/prod" Change-Id: Ibba46e69f69aca82698f51c31496dbe4c3a39eb5 Signed-off-by: Changcheng Liu --- ceph/ceph-manager/scripts/init.d/ceph-manager | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ceph/ceph-manager/scripts/init.d/ceph-manager b/ceph/ceph-manager/scripts/init.d/ceph-manager index 88bdddfb8..b0a0fc6c9 100644 --- a/ceph/ceph-manager/scripts/init.d/ceph-manager +++ b/ceph/ceph-manager/scripts/init.d/ceph-manager @@ -27,8 +27,8 @@ LOGFILE="/var/log/ceph-manager.log" start() { if [ -e $PIDFILE ]; then - PIDDIR=/prod/$(cat $PIDFILE) - if [ -d ${PIDFILE} ]; then + PIDDIR=/proc/$(cat $PIDFILE) + if [ -d ${PIDDIR} ]; then echo "$DESC already running." exit 0 else From d1dc7bdf90f1810fd9da5d7d531d8d9fd49505f6 Mon Sep 17 00:00:00 2001 From: Sun Austin Date: Mon, 17 Dec 2018 19:44:33 +0800 Subject: [PATCH 5/9] FIX: oct number issue for Python 2/3 compatible code change 00xxx or 0xxx to 0oxxx Story: 2002909 Task: 24561 Change-Id: I1e1ab809a6a1f68a7a1d20e13add314cda554ba5 Signed-off-by: Sun Austin --- logging/logmgmt/logmgmt/logmgmt/logmgmt.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/logging/logmgmt/logmgmt/logmgmt/logmgmt.py b/logging/logmgmt/logmgmt/logmgmt/logmgmt.py index 8850e2acc..c8d787c8c 100644 --- a/logging/logmgmt/logmgmt/logmgmt/logmgmt.py +++ b/logging/logmgmt/logmgmt/logmgmt/logmgmt.py @@ -78,7 +78,7 @@ class LogMgmtDaemon(): my_exec = os.path.basename(sys.argv[0]) if not os.path.exists(LOG_DIR): - os.mkdir(LOG_DIR, 0755) + os.mkdir(LOG_DIR, 0o755) log_format = '%(asctime)s: ' \ + my_exec + '[%(process)s]: ' \ From 707a12317bc5bfbacace9657550aa363ee6d08b4 Mon Sep 17 00:00:00 2001 From: Sun Austin Date: Tue, 18 Dec 2018 11:43:00 +0800 Subject: [PATCH 6/9] Fix: "dict" issue for Python 2/3 compatible code Replace dict.iteritems() with dict.items() Replace dict.iterkeys() with dict.keys() Change dict.keys() to list(dict.keys()) Story: 2002909 Task: 24564 Change-Id: Icf5ef6cc9947a87ee8e013d1225b3f36914e6678 Signed-off-by: Sun Austin --- .../ceph-manager/ceph_manager/exception.py | 2 +- .../scripts/live_stream.py | 18 ++--- .../storage_topology/exec/storage_topology.py | 2 +- .../vm_topology/exec/vm_topology.py | 74 +++++++++---------- 4 files changed, 48 insertions(+), 48 deletions(-) diff --git a/ceph/ceph-manager/ceph-manager/ceph_manager/exception.py b/ceph/ceph-manager/ceph-manager/ceph_manager/exception.py index 3ef078252..978fe752a 100644 --- a/ceph/ceph-manager/ceph-manager/ceph_manager/exception.py +++ b/ceph/ceph-manager/ceph-manager/ceph_manager/exception.py @@ -23,7 +23,7 @@ class CephManagerException(Exception): message = self.message % kwargs except TypeError: LOG.warn(_LW('Exception in string format operation')) - for name, value in kwargs.iteritems(): + for name, value in kwargs.items(): LOG.error("%s: %s" % (name, value)) # at least get the core message out if something happened message = self.message diff --git a/tools/engtools/hostdata-collectors/scripts/live_stream.py b/tools/engtools/hostdata-collectors/scripts/live_stream.py index bbdf120f9..7f7cbb054 100644 --- a/tools/engtools/hostdata-collectors/scripts/live_stream.py +++ b/tools/engtools/hostdata-collectors/scripts/live_stream.py @@ -106,7 +106,7 @@ def collectMemtop(influx_info, node, ci): fields["platform_avail"] += avail / MiB fields["platform_hfree"] += hfree f1.close() - s = generateString(measurement, tags.keys(), tags.values(), fields.keys(), fields.values()) + s = generateString(measurement, list(tags.keys()), list(tags.values()), list(fields.keys()), list(fields.values())) if s is None: good_string = False else: @@ -221,7 +221,7 @@ def collectMemstats(influx_info, node, ci, services, syseng_services, openstack_ fields["total"]["vsz"] += vsz break # send data to InfluxDB - for key in fields.keys(): + for key in fields: influx_string += "{},'{}'='{}','{}'='{}' '{}'='{}','{}'='{}'".format(measurement, "node", tags["node"], "service", key, "rss", fields[key]["rss"], "vsz", fields[key]["vsz"]) + "\n" p = Popen("curl -s -o /dev/null 'http://'{}':'{}'/write?db='{}'' --data-binary '{}'".format(influx_info[0], influx_info[1], influx_info[2], influx_string), shell=True) p.communicate() @@ -333,7 +333,7 @@ def collectSchedtop(influx_info, node, ci, services, syseng_services, openstack_ fields[svc] += occ fields["total"] += occ break - for key in fields.keys(): + for key in fields: influx_string += "{},'{}'='{}','{}'='{}' '{}'='{}'".format(measurement, "node", tags["node"], "service", key, "occ", fields[key]) + "\n" # send data to InfluxDB p = Popen("curl -s -o /dev/null 'http://'{}':'{}'/write?db='{}'' --data-binary '{}'".format(influx_info[0], influx_info[1], influx_info[2], influx_string), shell=True) @@ -800,7 +800,7 @@ def collectRabbitMq(influx_info, node, ci): info[i] = "processes_" + info[i] if info[i].replace("_", "").isalpha() and info[i + 1].isdigit(): fields[info[i]] = info[i + 1] - s = generateString(measurement, tags.keys(), tags.values(), fields.keys(), fields.values()) + s = generateString(measurement, list(tags.keys()), list(tags.values()), list(fields.keys()), list(fields.values())) if s is None: rabbitmq_output.kill() else: @@ -993,7 +993,7 @@ def collectFilestats(influx_info, node, ci, services, syseng_services, exclude_l p.kill() continue p.kill() - for key in fields.keys(): + for key in fields: influx_string += "{},'{}'='{}','{}'='{}' '{}'='{}','{}'='{}','{}'='{}'".format(measurement, "node", tags["node"], "service", key, "read/write", fields[key]["read/write"], "write", fields[key]["write"], "read", fields[key]["read"]) + "\n" # send data to InfluxDB p = Popen("curl -s -o /dev/null 'http://'{}':'{}'/write?db='{}'' --data-binary '{}'".format(influx_info[0], influx_info[1], influx_info[2], influx_string), shell=True) @@ -1041,7 +1041,7 @@ def collectVswitch(influx_info, node, ci): for key in fields: fields[key] = line[i].strip("%") i += 1 - influx_string += "{},'{}'='{}','{}'='{}' '{}'='{}','{}'='{}','{}'='{}','{}'='{}','{}'='{}','{}'='{}','{}'='{}','{}'='{}','{}'='{}'".format(measurement, tags.keys()[0], tags.values()[0], tags.keys()[1], tags.values()[1], fields.keys()[0], fields.values()[0], fields.keys()[1], fields.values()[1], fields.keys()[2], fields.values()[2], fields.keys()[3], fields.values()[3], fields.keys()[4], fields.values()[4], fields.keys()[5], fields.values()[5], fields.keys()[6], fields.values()[6], fields.keys()[7], fields.values()[7], fields.keys()[8], fields.values()[8]) + "\n" + influx_string += "{},'{}'='{}','{}'='{}' '{}'='{}','{}'='{}','{}'='{}','{}'='{}','{}'='{}','{}'='{}','{}'='{}','{}'='{}','{}'='{}'".format(measurement, list(tags.keys())[0], list(tags.values())[0], list(tags.keys())[1], list(tags.values())[1], list(fields.keys())[0], list(fields.values())[0], list(fields.keys())[1], list(fields.values())[1], list(fields.keys())[2], list(fields.values())[2], list(fields.keys())[3], list(fields.values())[3], list(fields.keys())[4], list(fields.values())[4], list(fields.keys())[5], list(fields.values())[5], list(fields.keys())[6], list(fields.values())[6], list(fields.keys())[7], list(fields.values())[7], list(fields.keys())[8], list(fields.values())[8]) + "\n" vshell_engine_stats_output.kill() vshell_port_stats_output = Popen("vshell port-stats-list", shell=True, stdout=PIPE) vshell_port_stats_output.stdout.readline() @@ -1059,7 +1059,7 @@ def collectVswitch(influx_info, node, ci): for key in fields1: fields1[key] = line[i].strip("%") i += 1 - influx_string += "{},'{}'='{}','{}'='{}' '{}'='{}','{}'='{}','{}'='{}','{}'='{}','{}'='{}','{}'='{}','{}'='{}'".format(measurement, tags1.keys()[0], tags1.values()[0], tags1.keys()[1], tags1.values()[1], fields1.keys()[0], fields1.values()[0], fields1.keys()[1], fields1.values()[1], fields1.keys()[2], fields1.values()[2], fields1.keys()[3], fields1.values()[3], fields1.keys()[4], fields1.values()[4], fields1.keys()[5], fields1.values()[5], fields1.keys()[6], fields1.values()[6]) + "\n" + influx_string += "{},'{}'='{}','{}'='{}' '{}'='{}','{}'='{}','{}'='{}','{}'='{}','{}'='{}','{}'='{}','{}'='{}'".format(measurement, list(tags1.keys())[0], list(tags1.values())[0], list(tags1.keys())[1], list(tags1.values())[1], list(fields1.keys())[0], list(fields1.values())[0], list(fields1.keys())[1], list(fields1.values())[1], list(fields1.keys())[2], list(fields1.values())[2], list(fields1.keys())[3], list(fields1.values())[3], list(fields1.keys())[4], list(fields1.values())[4], list(fields1.keys())[5], list(fields1.values())[5], list(fields1.keys())[6], list(fields1.values())[6]) + "\n" vshell_port_stats_output.kill() vshell_interface_stats_output = Popen("vshell interface-stats-list", shell=True, stdout=PIPE) vshell_interface_stats_output.stdout.readline() @@ -1078,7 +1078,7 @@ def collectVswitch(influx_info, node, ci): for key in fields2: fields2[key] = line[i].strip("%") i += 1 - influx_string += "{},'{}'='{}','{}'='{}' '{}'='{}','{}'='{}','{}'='{}','{}'='{}','{}'='{}','{}'='{}','{}'='{}','{}'='{}','{}'='{}','{}'='{}'".format(measurement, tags2.keys()[0], tags2.values()[0], tags2.keys()[1], tags2.values()[1], fields2.keys()[0], fields2.values()[0], fields2.keys()[1], fields2.values()[1], fields2.keys()[2], fields2.values()[2], fields2.keys()[3], fields2.values()[3], fields2.keys()[4], fields2.values()[4], fields2.keys()[5], fields2.values()[5], fields2.keys()[6], fields2.values()[6], fields2.keys()[7], fields2.values()[7], fields2.keys()[8], fields2.values()[8], fields2.keys()[9], fields2.values()[9]) + "\n" + influx_string += "{},'{}'='{}','{}'='{}' '{}'='{}','{}'='{}','{}'='{}','{}'='{}','{}'='{}','{}'='{}','{}'='{}','{}'='{}','{}'='{}','{}'='{}'".format(measurement, list(tags2.keys())[0], list(tags2.values())[0], list(tags2.keys())[1], list(tags2.values())[1], list(fields2.keys())[0], list(fields2.values())[0], list(fields2.keys())[1], list(fields2.values())[1], list(fields2.keys())[2], list(fields2.values())[2], list(fields2.keys())[3], list(fields2.values())[3], list(fields2.keys())[4], list(fields2.values())[4], list(fields2.keys())[5], list(fields2.values())[5], list(fields2.keys())[6], list(fields2.values())[6], list(fields2.keys())[7], list(fields2.values())[7], list(fields2.keys())[8], list(fields2.values())[8], list(fields2.keys())[9], list(fields2.values())[9]) + "\n" else: continue vshell_interface_stats_output.kill() @@ -1135,7 +1135,7 @@ def collectApiStats(influx_info, node, ci, services, db_port, rabbit_port): break lsof_lines.append(line) lsof_result.kill() - for name, service in services.iteritems(): + for name, service in services.items(): pid_list = list() check_pid = False if name == "keystone-public": diff --git a/tools/storage-topology/storage-topology/storage_topology/exec/storage_topology.py b/tools/storage-topology/storage-topology/storage_topology/exec/storage_topology.py index 5cc355b1d..c7e20bcc6 100644 --- a/tools/storage-topology/storage-topology/storage_topology/exec/storage_topology.py +++ b/tools/storage-topology/storage-topology/storage_topology/exec/storage_topology.py @@ -286,7 +286,7 @@ def get_info_and_display(cc, show=None): pv_pd_num_ext = 4 pv_pd_num = 3 - for k, v in host_storage_attr.iteritems(): + for k, v in host_storage_attr.items(): if show['diskview'] or show['all']: for disk_o in v['host_disks']: device_node = getattr(disk_o, 'device_node', '') diff --git a/tools/vm-topology/vm-topology/vm_topology/exec/vm_topology.py b/tools/vm-topology/vm-topology/vm_topology/exec/vm_topology.py index d35c42a42..6f3d0f1a6 100644 --- a/tools/vm-topology/vm-topology/vm_topology/exec/vm_topology.py +++ b/tools/vm-topology/vm-topology/vm_topology/exec/vm_topology.py @@ -287,7 +287,7 @@ def parse_arguments(debug, show): S[0:0] = L_opts # Enable debug option, but its usage/help is hidden. - D = debug.keys() + D = list(debug.keys()) D.sort() D.insert(0, 'all') @@ -338,7 +338,7 @@ def parse_arguments(debug, show): # Enable all debug flags (except libvirt_xml) if 'all' is specified x = debug['libvirt_xml'] if debug['all']: - {debug.update({e: True}) for e in debug.keys()} + {debug.update({e: True}) for e in debug} debug['libvirt_xml'] = x # Flatten show options list @@ -370,8 +370,8 @@ def _translate_keys(collection, convert): """ For a collection of elements, translate _info field names into human-readable names based on a list of conversion tuples. """ - for k, item in collection.iteritems(): - keys = item.__dict__.keys() + for k, item in collection.items(): + keys = list(item.__dict__.keys()) for from_key, to_key in convert: if from_key in keys and to_key not in keys: try: @@ -394,7 +394,7 @@ def _translate_extended_states(collection): 'Crashed', # 0x06 'Suspended' # 0x07 ] - for k, item in collection.iteritems(): + for k, item in collection.items(): try: setattr(item, 'power_state', power_states[getattr(item, 'power_state')]) @@ -624,7 +624,7 @@ def do_libvirt_domain_info((host)): up_total += 1 cpuset_total |= cpuset cpulist_f = _mask_to_cpulist(mask=cpuset_total) - for key in sorted(cpulist_d.iterkeys()): + for key in sorted(cpulist_d.keys()): cpulist_p.append(cpulist_d[key]) # Determine if floating or pinned, display appropriate cpulist @@ -833,7 +833,7 @@ def define_option_flags(show, options=[], if 'all' in options: {show.update({e: True}) for e in L_brief + L_details} for e in options: - if e in show.keys(): + if e in show: show.update({e: True}) @@ -898,9 +898,9 @@ def print_all_tables(tenants=None, for C in ['servers', 'pcpus', 'U:dedicated', 'U:shared', 'memory', 'U:memory', 'A:mem_4K', 'A:mem_2M', 'A:mem_1G']: pt.align[C] = 'r' - for host_name, H in sorted(hypervisors.iteritems(), + for host_name, H in sorted(hypervisors.items(), key=lambda (k, v): (natural_keys(k))): - A = agg_h[host_name].keys() + A = list(agg_h[host_name].keys()) try: topology_idx = topologies_idx[host_name] @@ -914,9 +914,9 @@ def print_all_tables(tenants=None, cpu_id = 0 socket_id = topology_idx[cpu_id]['s'] core_id = topology_idx[cpu_id]['c'] - n_sockets = len(topology.keys()) - n_cores = len(topology[socket_id].keys()) - n_threads = len(topology[socket_id][core_id].keys()) + n_sockets = len(list(topology.keys())) + n_cores = len(list(topology[socket_id].keys())) + n_threads = len(list(topology[socket_id][core_id].keys())) else: if 'topology' in H.cpu_info: topology = H.cpu_info['topology'] @@ -1019,7 +1019,7 @@ def print_all_tables(tenants=None, if show['topology']: print print('LOGICAL CPU TOPOLOGY (compute hosts):') - for host_name, topology in sorted(topologies.iteritems(), + for host_name, topology in sorted(topologies.items(), key=lambda (k, v): (natural_keys(k))): H = hypervisors[host_name] try: @@ -1038,9 +1038,9 @@ def print_all_tables(tenants=None, cpu_id = 0 socket_id = topology_idx[cpu_id]['s'] core_id = topology_idx[cpu_id]['c'] - n_sockets = len(topology.keys()) - n_cores = len(topology[socket_id].keys()) - n_threads = len(topology[socket_id][core_id].keys()) + n_sockets = len(list(topology.keys())) + n_cores = len(list(topology[socket_id].keys())) + n_threads = len(list(topology[socket_id][core_id].keys())) print('%s: Model:%s, Arch:%s, Vendor:%s, ' 'Sockets=%d, Cores/Socket=%d, Threads/Core=%d, Logical=%d' @@ -1083,7 +1083,7 @@ def print_all_tables(tenants=None, if show['topology-long']: print print('LOGICAL CPU TOPOLOGY (compute hosts):') - for host_name, topology in sorted(topologies.iteritems(), + for host_name, topology in sorted(topologies.items(), key=lambda (k, v): (natural_keys(k))): H = hypervisors[host_name] try: @@ -1102,9 +1102,9 @@ def print_all_tables(tenants=None, cpu_id = 0 socket_id = topology_idx[cpu_id]['s'] core_id = topology_idx[cpu_id]['c'] - n_sockets = len(topology.keys()) - n_cores = len(topology[socket_id].keys()) - n_threads = len(topology[socket_id][core_id].keys()) + n_sockets = len(list(topology.keys())) + n_cores = len(list(topology[socket_id].keys())) + n_threads = len(list(topology[socket_id][core_id].keys())) print('%s: Model:%s, Arch:%s, Vendor:%s, ' 'Sockets=%d, Cores/Socket=%d, Threads/Core=%d, Logical=%d' @@ -1160,7 +1160,7 @@ def print_all_tables(tenants=None, pt.align[C] = 'r' for C in ['in_libvirt']: pt.align[C] = 'c' - for _, S in sorted(servers.iteritems(), + for _, S in sorted(servers.items(), key=lambda (k, v): (natural_keys(v.host), v.server_group, v.instance_name) @@ -1211,7 +1211,7 @@ def print_all_tables(tenants=None, vcpus_scale = flavor_vcpus in_libvirt = False - for h, D in domains.iteritems(): + for h, D in domains.items(): if S.id in D: in_libvirt = True break @@ -1256,9 +1256,9 @@ def print_all_tables(tenants=None, pt.align[C] = 'r' for C in ['in_nova']: pt.align[C] = 'c' - for host, D in sorted(domains.iteritems(), + for host, D in sorted(domains.items(), key=lambda (k, v): (natural_keys(k))): - for _, S in sorted(D.iteritems(), + for _, S in sorted(D.items(), key=lambda (k, v): (v['name'])): in_nova = True if S['uuid'] in servers else False pt.add_row( @@ -1291,7 +1291,7 @@ def print_all_tables(tenants=None, 'created_at', ]) pt.align = 'l' - for _, M in sorted(migrations.iteritems(), + for _, M in sorted(migrations.items(), key=lambda (k, v): (k)): pt.add_row( [M.instance_uuid, @@ -1327,7 +1327,7 @@ def print_all_tables(tenants=None, for C in ['id', 'vcpus', 'ram', 'disk', 'ephemeral', 'swap', 'rxtx_factor']: pt.align[C] = 'r' - for _, F in sorted(flavors.iteritems(), + for _, F in sorted(flavors.items(), key=lambda (k, v): (k)): if F.id in flavors_in_use: pt.add_row( @@ -1361,7 +1361,7 @@ def print_all_tables(tenants=None, pt.align = 'l' for C in ['id', 'min_disk', 'min_ram', 'status']: pt.align[C] = 'r' - for _, I in sorted(images.iteritems(), + for _, I in sorted(images.items(), key=lambda (k, v): (k)): if I.id in images_in_use: pt.add_row( @@ -1387,7 +1387,7 @@ def print_all_tables(tenants=None, 'Metadata', ]) pt.align = 'l' - for _, S in sorted(server_groups.iteritems(), + for _, S in sorted(server_groups.items(), key=lambda (k, v): (k)): if S.id in server_groups_in_use: tenant = tenants[S.project_id].name @@ -1615,7 +1615,7 @@ def get_info_and_display(show=None): # translate fields into human-readable names _translate_keys(images, convert) - for I_id, I in images.iteritems(): + for I_id, I in images.items(): meta = copy.deepcopy(I.properties) I.properties = {} for k, v in meta.items(): @@ -1708,7 +1708,7 @@ def get_info_and_display(show=None): # Get extra_specs extra_specs = {} - for f_id, F in flavors.iteritems(): + for f_id, F in flavors.items(): try: specs = F.get_keys() except Exception as e: @@ -1794,7 +1794,7 @@ def get_info_and_display(show=None): # Build up aggregate list per compute host agg_h = {} - for H in hypervisors.keys(): + for H in hypervisors: agg_h[H] = {} for A in aggregates.values(): for H in A.hosts: @@ -1837,7 +1837,7 @@ def get_info_and_display(show=None): sys.exit(1) hosts = [] - for h in hypervisors.keys(): + for h in hypervisors: hosts.append(h) # Launch tasks @@ -1851,7 +1851,7 @@ def get_info_and_display(show=None): # Reap aged workers that exceed hang timeout now = time.time() reap = [] - for pid in active_pids.keys(): + for pid in active_pids: if pid == 0: continue try: @@ -1957,7 +1957,7 @@ def get_info_and_display(show=None): # We need libvirt topology information to make sense of cpusets. have_topology = True try: - if len(topologies_idx[host].keys()) < 1: + if len(list(topologies_idx[host].keys())) < 1: have_topology = False except: have_topology = False @@ -2042,7 +2042,7 @@ def get_info_and_display(show=None): server_mismatch = False for S in servers.values(): in_libvirt = False - for h, D in domains.iteritems(): + for h, D in domains.items(): if S.id in D and S.host == h: in_libvirt = True break @@ -2053,8 +2053,8 @@ def get_info_and_display(show=None): % (S.id, S.instance_name, S.name, S.host)) # Detect mismatch where server is in libvirt but not in nova - for host, D in domains.iteritems(): - for k, S in D.iteritems(): + for host, D in domains.items(): + for k, S in D.items(): in_nova = False uuid = S['uuid'] if uuid in servers and servers[uuid].host == host: From fc9b6f94a899eaa9b32fecde0b7a2d9b0a1f65e5 Mon Sep 17 00:00:00 2001 From: Sun Austin Date: Tue, 18 Dec 2018 13:10:58 +0800 Subject: [PATCH 7/9] Fix: "map" issue for Python 2/3 compatible code Replace map(func, data) with [func(item) for item in data] Story: 2002909 Task: 24563 Change-Id: I83004eeba036908da483b247093818a6ac3f19c1 Signed-off-by: Sun Austin --- tools/engtools/hostdata-collectors/scripts/buddyinfo.py | 2 +- tools/vm-topology/vm-topology/vm_topology/exec/vm_topology.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/engtools/hostdata-collectors/scripts/buddyinfo.py b/tools/engtools/hostdata-collectors/scripts/buddyinfo.py index 2737fe408..b20435d6d 100644 --- a/tools/engtools/hostdata-collectors/scripts/buddyinfo.py +++ b/tools/engtools/hostdata-collectors/scripts/buddyinfo.py @@ -57,7 +57,7 @@ class BuddyInfo(object): for line in map(self.parse_line, buddyinfo): numa_node = int(line["numa_node"]) zone = line["zone"] - free_fragments = map(int, line["nr_free"].split()) + free_fragments = [int(nr) for nr in line["nr_free"].split()] max_order = len(free_fragments) fragment_sizes = self.get_order_sizes(max_order) usage_in_bytes = [block[0] * block[1] for block in zip(free_fragments, fragment_sizes)] diff --git a/tools/vm-topology/vm-topology/vm_topology/exec/vm_topology.py b/tools/vm-topology/vm-topology/vm_topology/exec/vm_topology.py index 6f3d0f1a6..dbf8f81d0 100644 --- a/tools/vm-topology/vm-topology/vm_topology/exec/vm_topology.py +++ b/tools/vm-topology/vm-topology/vm_topology/exec/vm_topology.py @@ -492,7 +492,7 @@ def range_to_list(csv_range=None): """ if not csv_range: return [] - ranges = [(lambda L: range(L[0], L[-1] + 1))(map(int, r.split('-'))) + ranges = [(lambda L: range(L[0], L[-1] + 1))([int(x) for x in r.split('-')]) for r in csv_range.split(',')] return [y for x in ranges for y in x] From d33383743e5a0b494cbae23d2e389beb993d6a30 Mon Sep 17 00:00:00 2001 From: slin14 Date: Wed, 26 Sep 2018 20:07:50 +0800 Subject: [PATCH 8/9] rebase drbd drver patch to 8.4.11-1 version "compat-Statically-initialize-families.patch" is already contained in the new version, so delete it. Reset TIS_PATCH_VER to 0 since version is upgraded. Depends-On: https://review.openstack.org/605292 Story: 2003597 Task: 26588 Change-Id: I628f5b0497df188ea9fa7b7860b56de78382c510 Signed-off-by: slin14 --- .../drbd/centos/build_srpm.data | 4 +- .../drbd/centos/drbd-kernel.spec | 4 +- ...001-remove_bind_before_connect_error.patch | 2 +- ...ompat-Statically-initialize-families.patch | 171 ------------------ 4 files changed, 4 insertions(+), 177 deletions(-) delete mode 100644 kernel/kernel-modules/drbd/centos/patches/compat-Statically-initialize-families.patch diff --git a/kernel/kernel-modules/drbd/centos/build_srpm.data b/kernel/kernel-modules/drbd/centos/build_srpm.data index 71dcefb15..c6bd5a8c8 100644 --- a/kernel/kernel-modules/drbd/centos/build_srpm.data +++ b/kernel/kernel-modules/drbd/centos/build_srpm.data @@ -1,4 +1,4 @@ COPY_LIST="$FILES_BASE/* \ $DISTRO/patches/* \ - $CGCS_BASE/downloads/drbd-8.4.7-1.tar.gz" -TIS_PATCH_VER=4 + $CGCS_BASE/downloads/drbd-8.4.11-1.tar.gz" +TIS_PATCH_VER=0 diff --git a/kernel/kernel-modules/drbd/centos/drbd-kernel.spec b/kernel/kernel-modules/drbd/centos/drbd-kernel.spec index 23e8fe898..f9e903d1a 100644 --- a/kernel/kernel-modules/drbd/centos/drbd-kernel.spec +++ b/kernel/kernel-modules/drbd/centos/drbd-kernel.spec @@ -9,7 +9,7 @@ Name: drbd-kernel%{?bt_ext} Summary: Kernel driver for DRBD -Version: 8.4.7 +Version: 8.4.11 %define upstream_release 1 Release: %{upstream_release}%{?_tis_dist}.%{tis_patch_ver} %global tarball_version %(echo "%{version}-%{?upstream_release}" | sed -e "s,%{?dist}$,,") @@ -25,7 +25,6 @@ Source0: http://oss.linbit.com/drbd/drbd-%{tarball_version}.tar.gz # WRS Patch0001: 0001-remove_bind_before_connect_error.patch -Patch0002: compat-Statically-initialize-families.patch %define kversion %(rpm -q kernel%{?bt_ext}-devel | sort --version-sort | tail -1 | sed 's/kernel%{?bt_ext}-devel-//') @@ -86,7 +85,6 @@ echo "Done." %prep %setup -q -n drbd-%{tarball_version} %patch0001 -p1 -%patch0002 -p1 %build rm -rf obj diff --git a/kernel/kernel-modules/drbd/centos/patches/0001-remove_bind_before_connect_error.patch b/kernel/kernel-modules/drbd/centos/patches/0001-remove_bind_before_connect_error.patch index 2060d51c7..88b6fbc77 100644 --- a/kernel/kernel-modules/drbd/centos/patches/0001-remove_bind_before_connect_error.patch +++ b/kernel/kernel-modules/drbd/centos/patches/0001-remove_bind_before_connect_error.patch @@ -2,7 +2,7 @@ Index: drbd-8.4.7-1/drbd/drbd_receiver.c =================================================================== --- drbd-8.4.7-1.orig/drbd/drbd_receiver.c +++ drbd-8.4.7-1/drbd/drbd_receiver.c -@@ -718,6 +718,7 @@ out: +@@ -719,6 +719,7 @@ out: /* peer not (yet) available, network problem */ case ECONNREFUSED: case ENETUNREACH: case EHOSTDOWN: case EHOSTUNREACH: diff --git a/kernel/kernel-modules/drbd/centos/patches/compat-Statically-initialize-families.patch b/kernel/kernel-modules/drbd/centos/patches/compat-Statically-initialize-families.patch deleted file mode 100644 index a64d1765f..000000000 --- a/kernel/kernel-modules/drbd/centos/patches/compat-Statically-initialize-families.patch +++ /dev/null @@ -1,171 +0,0 @@ -From 7510d78909774e33b64ada4055bea65881350763 Mon Sep 17 00:00:00 2001 -Message-Id: <7510d78909774e33b64ada4055bea65881350763.1528136610.git.Jim.Somerville@windriver.com> -From: Nick Wang -Date: Mon, 13 Mar 2017 15:23:29 +0800 -Subject: [PATCH 1/1] compat: Statically initialize families - -In a07ea4d9, genetlink no longer use static family id. -GENL_ID_GENERATE is removed. -In 489111e5, statically initialize the families and remove -the inline functions. - -Thanks to Nick Wang for preparing a first draft. -Unfortunately this version actually broke netlink on v4.10. Probably -only compile-tested, but never "drbdadm up" tested. - -Signed-off-by: Nick Wang -[add missing pieces introduced in 489111e5] -Signed-off-by: Roland Kammerer -[Simplified :-) and backported to drbd 8.4] -Signed-off-by: Lars Ellenberg - -Signed-off-by: Jim Somerville ---- - .../tests/have_genl_family_in_genlmsg_multicast.c | 9 ++++++ - drbd/compat/tests/have_genl_id_generate.c | 6 ++++ - .../tests/have_genl_register_family_with_ops.c | 9 ++++++ - .../tests/have_genl_register_family_with_ops3.c | 9 ++++++ - ...gic_func-genl_register_family_with_ops_groups.h | 4 +++ - drbd/linux/genl_magic_func.h | 34 +++++++++++++++------- - 6 files changed, 61 insertions(+), 10 deletions(-) - create mode 100644 drbd/compat/tests/have_genl_family_in_genlmsg_multicast.c - create mode 100644 drbd/compat/tests/have_genl_id_generate.c - create mode 100644 drbd/compat/tests/have_genl_register_family_with_ops.c - create mode 100644 drbd/compat/tests/have_genl_register_family_with_ops3.c - -diff --git a/drbd/compat/tests/have_genl_family_in_genlmsg_multicast.c b/drbd/compat/tests/have_genl_family_in_genlmsg_multicast.c -new file mode 100644 -index 0000000..6d44faa ---- /dev/null -+++ b/drbd/compat/tests/have_genl_family_in_genlmsg_multicast.c -@@ -0,0 +1,9 @@ -+#include -+ -+void test(void) -+{ -+ struct genl_family family = { }; -+ struct sk_buff *skb = NULL; -+ -+ genlmsg_multicast(&family, skb, 0, 0, GFP_KERNEL); -+} -diff --git a/drbd/compat/tests/have_genl_id_generate.c b/drbd/compat/tests/have_genl_id_generate.c -new file mode 100644 -index 0000000..4ef0e8e ---- /dev/null -+++ b/drbd/compat/tests/have_genl_id_generate.c -@@ -0,0 +1,6 @@ -+#include -+ -+void test(void) -+{ -+ int i = GENL_ID_GENERATE; -+} -diff --git a/drbd/compat/tests/have_genl_register_family_with_ops.c b/drbd/compat/tests/have_genl_register_family_with_ops.c -new file mode 100644 -index 0000000..27123db ---- /dev/null -+++ b/drbd/compat/tests/have_genl_register_family_with_ops.c -@@ -0,0 +1,9 @@ -+#include -+ -+void test(void) -+{ -+ struct genl_family family = { }; -+ struct genl_ops ops[23]; -+ -+ genl_register_family_with_ops(&family, ops); -+} -diff --git a/drbd/compat/tests/have_genl_register_family_with_ops3.c b/drbd/compat/tests/have_genl_register_family_with_ops3.c -new file mode 100644 -index 0000000..11b6d73 ---- /dev/null -+++ b/drbd/compat/tests/have_genl_register_family_with_ops3.c -@@ -0,0 +1,9 @@ -+#include -+ -+void test(void) -+{ -+ struct genl_family family = { }; -+ struct genl_ops ops[23]; -+ -+ genl_register_family_with_ops(&family, ops, 23); -+} -diff --git a/drbd/linux/genl_magic_func-genl_register_family_with_ops_groups.h b/drbd/linux/genl_magic_func-genl_register_family_with_ops_groups.h -index 27d8f73..403e8e2 100644 ---- a/drbd/linux/genl_magic_func-genl_register_family_with_ops_groups.h -+++ b/drbd/linux/genl_magic_func-genl_register_family_with_ops_groups.h -@@ -29,9 +29,13 @@ static int CONCAT_(GENL_MAGIC_FAMILY, _genl_multicast_ ## group)( \ - - int CONCAT_(GENL_MAGIC_FAMILY, _genl_register)(void) - { -+#if defined(COMPAT_HAVE_GENL_REGISTER_FAMILY_WITH_OPS) || defined(COMPAT_HAVE_GENL_REGISTER_FAMILY_WITH_OPS3) - return genl_register_family_with_ops_groups(&ZZZ_genl_family, \ - ZZZ_genl_ops, \ - ZZZ_genl_mcgrps); -+#else -+ return genl_register_family(&ZZZ_genl_family); -+#endif - } - - void CONCAT_(GENL_MAGIC_FAMILY, _genl_unregister)(void) -diff --git a/drbd/linux/genl_magic_func.h b/drbd/linux/genl_magic_func.h -index 29f44a8..504719a 100644 ---- a/drbd/linux/genl_magic_func.h -+++ b/drbd/linux/genl_magic_func.h -@@ -261,15 +261,7 @@ static struct genl_ops ZZZ_genl_ops[] __read_mostly = { - * {{{2 - */ - #define ZZZ_genl_family CONCAT_(GENL_MAGIC_FAMILY, _genl_family) --static struct genl_family ZZZ_genl_family __read_mostly = { -- .id = GENL_ID_GENERATE, -- .name = __stringify(GENL_MAGIC_FAMILY), -- .version = GENL_MAGIC_VERSION, --#ifdef GENL_MAGIC_FAMILY_HDRSZ -- .hdrsize = NLA_ALIGN(GENL_MAGIC_FAMILY_HDRSZ), --#endif -- .maxattr = ARRAY_SIZE(drbd_tla_nl_policy)-1, --}; -+static struct genl_family ZZZ_genl_family; - - /* - * Magic: define multicast groups -@@ -282,13 +274,35 @@ static struct genl_family ZZZ_genl_family __read_mostly = { - * genetlink: pass family to functions using groups - * genetlink: only pass array to genl_register_family_with_ops() - * which are commits c53ed742..2a94fe48 -+ * -+ * v4.10, 489111e5 genetlink: statically initialize families -+ * and previous commit drop GENL_ID_GENERATE and register helper functions. - */ --#ifdef genl_register_family_with_ops_groups -+#if defined(genl_register_family_with_ops_groups) || !defined(GENL_ID_GENERATE) - #include - #else - #include - #endif - -+static struct genl_family ZZZ_genl_family __read_mostly = { -+ /* .id = GENL_ID_GENERATE, which exists no longer, and was 0 anyways */ -+ .name = __stringify(GENL_MAGIC_FAMILY), -+ .version = GENL_MAGIC_VERSION, -+#ifdef GENL_MAGIC_FAMILY_HDRSZ -+ .hdrsize = NLA_ALIGN(GENL_MAGIC_FAMILY_HDRSZ), -+#endif -+ .maxattr = ARRAY_SIZE(CONCAT_(GENL_MAGIC_FAMILY, _tla_nl_policy))-1, -+ -+#ifndef GENL_ID_GENERATE -+ .ops = ZZZ_genl_ops, -+ .n_ops = ARRAY_SIZE(ZZZ_genl_ops), -+ .mcgrps = ZZZ_genl_mcgrps, -+ .n_mcgrps = ARRAY_SIZE(ZZZ_genl_mcgrps), -+ .module = THIS_MODULE, -+#endif -+}; -+ -+ - /* - * Magic: provide conversion functions {{{1 - * populate skb from struct. --- -1.8.3.1 - From c8f39de9a0d56b2c86e204445fc4b097ca718deb Mon Sep 17 00:00:00 2001 From: Eric MacDonald Date: Wed, 2 Jan 2019 10:21:06 -0500 Subject: [PATCH 9/9] Implement collectd startup in manifest apply post stage Starting collectd too early in the manifest apply is seen to occasionally fail due to a dependency configuration on hostname resolution in FQDNLookup not being complete. Since influxdb is used by collectd and is a controller only service this update moves it to the manifest apply post stage as well and is filtered out from non controller load types. This issue is fixed by the following multi-git changes. stx-metal: Filter influxdb out of storage and compute only loads. No real inter git merge dependency stx-integ: This update. Add startup Before=pmond dependency stx-config: Move collectd config and startup to manifest apply post stage Move influxdb config and startup to manifest apply post stage Test Plan: PASS: Build iso PASS: verify install storage system and collectd startup PASS: Verify Storage system DOR PASS: Verify influxdb and extensions excluded in non-controller loads PASS: Verify collectd starts properly on all nodes (CC,DOR,UNLOCK) PASS: Verify influxdb starts properly on controller nodes (CC,DOR,UNLOCK) PASS: Verify collectd pmond process monitoring and recovery PASS: Verify influxdb pmond process monitoring and recovery PEND: Verify collectd statistics storage and fetch to/from influxdb PEND: Install AIO DX and verify collectd and influxdb startup Change-Id: I47d70b05bdbdd22f8fce2f56fcc287fac7371ace Closes-Bug: 1797909 Signed-off-by: Eric MacDonald --- monitoring/collectd-extensions/centos/build_srpm.data | 2 +- monitoring/collectd-extensions/src/collectd.service | 1 + monitoring/influxdb-extensions/centos/build_srpm.data | 2 +- monitoring/influxdb-extensions/src/influxdb.service | 4 +++- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/monitoring/collectd-extensions/centos/build_srpm.data b/monitoring/collectd-extensions/centos/build_srpm.data index fb8be4619..52d21566f 100644 --- a/monitoring/collectd-extensions/centos/build_srpm.data +++ b/monitoring/collectd-extensions/centos/build_srpm.data @@ -16,4 +16,4 @@ COPY_LIST="$PKG_BASE/src/LICENSE \ $PKG_BASE/src/example.py \ $PKG_BASE/src/example.conf" -TIS_PATCH_VER=3 +TIS_PATCH_VER=4 diff --git a/monitoring/collectd-extensions/src/collectd.service b/monitoring/collectd-extensions/src/collectd.service index 14d12c327..1ac7cb036 100644 --- a/monitoring/collectd-extensions/src/collectd.service +++ b/monitoring/collectd-extensions/src/collectd.service @@ -1,6 +1,7 @@ [Unit] Description=Collectd statistics daemon and extension services Documentation=man:collectd(1) man:collectd.conf(5) +Before=pmon.service After=local-fs.target network-online.target Requires=local-fs.target network-online.target diff --git a/monitoring/influxdb-extensions/centos/build_srpm.data b/monitoring/influxdb-extensions/centos/build_srpm.data index 2be8701c6..03c5dbcc8 100644 --- a/monitoring/influxdb-extensions/centos/build_srpm.data +++ b/monitoring/influxdb-extensions/centos/build_srpm.data @@ -4,4 +4,4 @@ COPY_LIST="$PKG_BASE/src/LICENSE \ $PKG_BASE/src/influxdb.conf.pmon \ $PKG_BASE/src/influxdb.service" -TIS_PATCH_VER=1 +TIS_PATCH_VER=2 diff --git a/monitoring/influxdb-extensions/src/influxdb.service b/monitoring/influxdb-extensions/src/influxdb.service index 2d3104873..7617d2a6e 100644 --- a/monitoring/influxdb-extensions/src/influxdb.service +++ b/monitoring/influxdb-extensions/src/influxdb.service @@ -1,8 +1,10 @@ [Unit] Description=InfluxDB open-source, distributed, time series database Documentation=https://influxdb.com/docs/ -After=local-fs.target network.target Before=collectd.service +Before=pmon.service +After=local-fs.target network-online.target +Requires=local-fs.target network-online.target [Service] User=influxdb