Merge "Refactor patches for openstack-aodh package"

This commit is contained in:
Zuul 2018-12-04 06:57:49 +00:00 committed by Gerrit Code Review
commit ab0ad16fcf
19 changed files with 253 additions and 406 deletions

View File

@ -154,6 +154,7 @@ openstack-aodh-evaluator
openstack-aodh-notifier
openstack-aodh-listener
openstack-aodh-expirer
openstack-aodh-config
# openstack-panko
python-panko

View File

@ -1,4 +1,5 @@
openstack/openstack-aodh
openstack/openstack-aodh-config
openstack/openstack-murano
openstack/python-muranoclient
openstack/openstack-murano-ui

View File

@ -0,0 +1,2 @@
SRC_DIR="files"
TIS_PATCH_VER=0

View File

@ -0,0 +1,51 @@
Summary: openstack-aodh-config
Name: openstack-aodh-config
Version: 1.0
Release: %{tis_patch_ver}%{?_tis_dist}
License: Apache-2.0
Group: openstack
Packager: StarlingX
URL: unknown
BuildArch: noarch
Source: %name-%version.tar.gz
Requires: openstack-aodh-common
Requires: openstack-aodh-api
Requires: openstack-aodh-evaluator
Requires: openstack-aodh-notifier
Requires: openstack-aodh-expirer
Requires: openstack-aodh-listener
Summary: package StarlingX configuration files of openstack-aodh to system folder.
%description
package StarlingX configuration files of openstack-aodh to system folder.
%prep
%setup
%build
%install
%{__install} -d %{buildroot}%{_sysconfdir}/systemd/system
%{__install} -d %{buildroot}%{_bindir}
%{__install} -m 0644 openstack-aodh-api.service %{buildroot}%{_sysconfdir}/systemd/system/openstack-aodh-api.service
%{__install} -m 0644 openstack-aodh-evaluator.service %{buildroot}%{_sysconfdir}/systemd/system/openstack-aodh-evaluator.service
%{__install} -m 0644 openstack-aodh-expirer.service %{buildroot}%{_sysconfdir}/systemd/system/openstack-aodh-expirer.service
%{__install} -m 0644 openstack-aodh-listener.service %{buildroot}%{_sysconfdir}/systemd/system/openstack-aodh-listener.service
%{__install} -m 0644 openstack-aodh-notifier.service %{buildroot}%{_sysconfdir}/systemd/system/openstack-aodh-notifier.service
%{__install} -m 0750 aodh-expirer-active %{buildroot}%{_bindir}/aodh-expirer-active
%post
if test -s %{_sysconfdir}/logrotate.d/openstack-aodh ; then
echo '#See /etc/logrotate.d/syslog for aodh rules' > %{_sysconfdir}/logrotate.d/openstack-aodh
fi
%files
%{_sysconfdir}/systemd/system/openstack-aodh-api.service
%{_sysconfdir}/systemd/system/openstack-aodh-evaluator.service
%{_sysconfdir}/systemd/system/openstack-aodh-expirer.service
%{_sysconfdir}/systemd/system/openstack-aodh-listener.service
%{_sysconfdir}/systemd/system/openstack-aodh-notifier.service
%{_bindir}/aodh-expirer-active

View File

@ -0,0 +1,61 @@
#!/bin/bash
#
# Wrapper script to run aodh-expirer when on active controller only
#
AODH_EXPIRER_INFO="/var/run/aodh-expirer.info"
AODH_EXPIRER_CMD="/usr/bin/nice -n 2 /usr/bin/aodh-expirer"
function is_active_pgserver()
{
# Determine whether we're running on the same controller as the service.
local service=postgres
local enabledactive=$(/usr/bin/sm-query service $service| grep enabled-active)
if [ "x$enabledactive" == "x" ]
then
# enabled-active not found for that service on this controller
return 1
else
# enabled-active found for that resource
return 0
fi
}
if is_active_pgserver
then
if [ ! -f ${AODH_EXPIRER_INFO} ]
then
echo delay_count=0 > ${AODH_EXPIRER_INFO}
fi
source ${AODH_EXPIRER_INFO}
sudo -u postgres psql -d sysinv -c "SELECT alarm_id, entity_instance_id from i_alarm;" | grep -P "^(?=.*100.101)(?=.*${HOSTNAME})" &>/dev/null
if [ $? -eq 0 ]
then
source /etc/platform/platform.conf
if [ "${system_type}" = "All-in-one" ]
then
source /etc/init.d/task_affinity_functions.sh
idle_core=$(get_most_idle_core)
if [ "$idle_core" -ne "0" ]
then
sh -c "exec taskset -c $idle_core ${AODH_EXPIRER_CMD}"
sed -i "/delay_count/s/=.*/=0/" ${AODH_EXPIRER_INFO}
exit 0
fi
fi
if [ "$delay_count" -lt "3" ]
then
newval=$(($delay_count+1))
sed -i "/delay_count/s/=.*/=$newval/" ${AODH_EXPIRER_INFO}
(sleep 3600; /usr/bin/aodh-expirer-active) &
exit 0
fi
fi
eval ${AODH_EXPIRER_CMD}
sed -i "/delay_count/s/=.*/=0/" ${AODH_EXPIRER_INFO}
fi
exit 0

View File

@ -0,0 +1,11 @@
[Unit]
Description=OpenStack Alarm API service
After=syslog.target network.target
[Service]
Type=simple
User=root
ExecStart=/bin/python /usr/bin/gunicorn --config /usr/share/aodh/aodh-api.conf --pythonpath /usr/share/aodh aodh-api
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1,11 @@
[Unit]
Description=OpenStack Alarm evaluator service
After=syslog.target network.target
[Service]
Type=simple
User=root
ExecStart=/usr/bin/aodh-evaluator
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1,11 @@
[Unit]
Description=OpenStack Alarm expirer service
After=syslog.target network.target
[Service]
Type=simple
User=root
ExecStart=/usr/bin/aodh-expirer
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1,11 @@
[Unit]
Description=OpenStack Alarm listener service
After=syslog.target network.target
[Service]
Type=simple
User=root
ExecStart=/usr/bin/aodh-listener
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1,11 @@
[Unit]
Description=OpenStack Alarm notifier service
After=syslog.target network.target
[Service]
Type=simple
User=root
ExecStart=/usr/bin/aodh-notifier
[Install]
WantedBy=multi-user.target

View File

@ -1 +1 @@
TIS_PATCH_VER=6
TIS_PATCH_VER=7

View File

@ -1,226 +0,0 @@
From a3e86bdcd7a9507b7271c70aba5f9ac67ee6cdb6 Mon Sep 17 00:00:00 2001
From: Scott Little <scott.little@windriver.com>
Date: Mon, 2 Oct 2017 14:28:46 -0400
Subject: [PATCH 1/6] WRS:
0001-Modify-service-files-and-create-expirer-cron-script.patch
Conflicts:
SPECS/openstack-aodh.spec
---
SOURCES/aodh-expirer-active | 61 ++++++++++++++++++++++++++++++++
SOURCES/openstack-aodh-api.service | 5 ++-
SOURCES/openstack-aodh-evaluator.service | 5 ++-
SOURCES/openstack-aodh-expirer.service | 5 ++-
SOURCES/openstack-aodh-listener.service | 5 ++-
SOURCES/openstack-aodh-notifier.service | 5 ++-
SPECS/openstack-aodh.spec | 11 ++++--
7 files changed, 80 insertions(+), 17 deletions(-)
create mode 100644 SOURCES/aodh-expirer-active
diff --git a/SOURCES/aodh-expirer-active b/SOURCES/aodh-expirer-active
new file mode 100644
index 0000000..796a694
--- /dev/null
+++ b/SOURCES/aodh-expirer-active
@@ -0,0 +1,61 @@
+#!/bin/bash
+
+#
+# Wrapper script to run aodh-expirer when on active controller only
+#
+AODH_EXPIRER_INFO="/var/run/aodh-expirer.info"
+AODH_EXPIRER_CMD="/usr/bin/nice -n 2 /usr/bin/aodh-expirer"
+
+function is_active_pgserver()
+{
+ # Determine whether we're running on the same controller as the service.
+ local service=postgres
+ local enabledactive=$(/usr/bin/sm-query service $service| grep enabled-active)
+ if [ "x$enabledactive" == "x" ]
+ then
+ # enabled-active not found for that service on this controller
+ return 1
+ else
+ # enabled-active found for that resource
+ return 0
+ fi
+}
+
+if is_active_pgserver
+then
+ if [ ! -f ${AODH_EXPIRER_INFO} ]
+ then
+ echo delay_count=0 > ${AODH_EXPIRER_INFO}
+ fi
+
+ source ${AODH_EXPIRER_INFO}
+ sudo -u postgres psql -d sysinv -c "SELECT alarm_id, entity_instance_id from i_alarm;" | grep -P "^(?=.*100.101)(?=.*${HOSTNAME})" &>/dev/null
+ if [ $? -eq 0 ]
+ then
+ source /etc/platform/platform.conf
+ if [ "${system_type}" = "All-in-one" ]
+ then
+ source /etc/init.d/task_affinity_functions.sh
+ idle_core=$(get_most_idle_core)
+ if [ "$idle_core" -ne "0" ]
+ then
+ sh -c "exec taskset -c $idle_core ${AODH_EXPIRER_CMD}"
+ sed -i "/delay_count/s/=.*/=0/" ${AODH_EXPIRER_INFO}
+ exit 0
+ fi
+ fi
+
+ if [ "$delay_count" -lt "3" ]
+ then
+ newval=$(($delay_count+1))
+ sed -i "/delay_count/s/=.*/=$newval/" ${AODH_EXPIRER_INFO}
+ (sleep 3600; /usr/bin/aodh-expirer-active) &
+ exit 0
+ fi
+ fi
+
+ eval ${AODH_EXPIRER_CMD}
+ sed -i "/delay_count/s/=.*/=0/" ${AODH_EXPIRER_INFO}
+fi
+
+exit 0
diff --git a/SOURCES/openstack-aodh-api.service b/SOURCES/openstack-aodh-api.service
index 29db382..b8b2921 100644
--- a/SOURCES/openstack-aodh-api.service
+++ b/SOURCES/openstack-aodh-api.service
@@ -4,9 +4,8 @@ After=syslog.target network.target
[Service]
Type=simple
-User=aodh
-ExecStart=/usr/bin/aodh-api -- --logfile /var/log/aodh/api.log
-Restart=on-failure
+User=root
+ExecStart=/usr/bin/aodh-api
[Install]
WantedBy=multi-user.target
diff --git a/SOURCES/openstack-aodh-evaluator.service b/SOURCES/openstack-aodh-evaluator.service
index 4f70431..795ef0c 100644
--- a/SOURCES/openstack-aodh-evaluator.service
+++ b/SOURCES/openstack-aodh-evaluator.service
@@ -4,9 +4,8 @@ After=syslog.target network.target
[Service]
Type=simple
-User=aodh
-ExecStart=/usr/bin/aodh-evaluator --logfile /var/log/aodh/evaluator.log
-Restart=on-failure
+User=root
+ExecStart=/usr/bin/aodh-evaluator
[Install]
WantedBy=multi-user.target
diff --git a/SOURCES/openstack-aodh-expirer.service b/SOURCES/openstack-aodh-expirer.service
index cc68b1b..0185d63 100644
--- a/SOURCES/openstack-aodh-expirer.service
+++ b/SOURCES/openstack-aodh-expirer.service
@@ -4,9 +4,8 @@ After=syslog.target network.target
[Service]
Type=simple
-User=aodh
-ExecStart=/usr/bin/aodh-expirer --logfile /var/log/aodh/expirer.log
-Restart=on-failure
+User=root
+ExecStart=/usr/bin/aodh-expirer
[Install]
WantedBy=multi-user.target
diff --git a/SOURCES/openstack-aodh-listener.service b/SOURCES/openstack-aodh-listener.service
index a024fe3..40e20d2 100644
--- a/SOURCES/openstack-aodh-listener.service
+++ b/SOURCES/openstack-aodh-listener.service
@@ -4,9 +4,8 @@ After=syslog.target network.target
[Service]
Type=simple
-User=aodh
-ExecStart=/usr/bin/aodh-listener --logfile /var/log/aodh/listener.log
-Restart=on-failure
+User=root
+ExecStart=/usr/bin/aodh-listener
[Install]
WantedBy=multi-user.target
diff --git a/SOURCES/openstack-aodh-notifier.service b/SOURCES/openstack-aodh-notifier.service
index d6135d7..68a96dd 100644
--- a/SOURCES/openstack-aodh-notifier.service
+++ b/SOURCES/openstack-aodh-notifier.service
@@ -4,9 +4,8 @@ After=syslog.target network.target
[Service]
Type=simple
-User=aodh
-ExecStart=/usr/bin/aodh-notifier --logfile /var/log/aodh/notifier.log
-Restart=on-failure
+User=root
+ExecStart=/usr/bin/aodh-notifier
[Install]
WantedBy=multi-user.target
diff --git a/SPECS/openstack-aodh.spec b/SPECS/openstack-aodh.spec
index 9fffb3c..cac691f 100644
--- a/SPECS/openstack-aodh.spec
+++ b/SPECS/openstack-aodh.spec
@@ -18,6 +18,9 @@ Source12: %{name}-notifier.service
Source13: %{name}-expirer.service
Source14: %{name}-listener.service
+#WRS
+Source20: aodh-expirer-active
+
BuildArch: noarch
BuildRequires: openstack-macros
@@ -262,7 +265,7 @@ install -p -D -m 640 aodh/api/policy.json %{buildroot}%{_sysconfdir}/aodh/policy
# Setup directories
install -d -m 755 %{buildroot}%{_sharedstatedir}/aodh
install -d -m 755 %{buildroot}%{_sharedstatedir}/aodh/tmp
-install -d -m 750 %{buildroot}%{_localstatedir}/log/aodh
+install -d -m 755 %{buildroot}%{_localstatedir}/log/aodh
# Install logrotate
install -p -D -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
@@ -283,6 +286,9 @@ mv %{buildroot}%{python2_sitelib}/%{pypi_name}/locale %{buildroot}%{_datadir}/lo
# Find language files
%find_lang %{pypi_name} --all-name
+# WRS
+install -p -D -m 750 %{SOURCE20} %{buildroot}%{_bindir}/aodh-expirer-active
+
# Remove unused files
rm -fr %{buildroot}/usr/etc
@@ -345,7 +351,6 @@ exit 0
%config(noreplace) %attr(-, root, aodh) %{_sysconfdir}/aodh/policy.json
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
%dir %attr(0750, aodh, root) %{_localstatedir}/log/aodh
-%{_bindir}/aodh-dbsync
%{_bindir}/aodh-config-generator
%defattr(-, aodh, aodh, -)
@@ -353,6 +358,7 @@ exit 0
%dir %{_sharedstatedir}/aodh/tmp
%files api
+%{_bindir}/aodh-dbsync
%{_bindir}/aodh-api
%{_unitdir}/%{name}-api.service
@@ -371,6 +377,7 @@ exit 0
%files expirer
%{_bindir}/aodh-expirer
+%{_bindir}/aodh-expirer-active
%{_unitdir}/%{name}-expirer.service
--
2.7.4

View File

@ -3,18 +3,17 @@ From: Scott Little <scott.little@windriver.com>
Date: Mon, 2 Oct 2017 14:28:46 -0400
Subject: [PATCH 2/6] WRS: 0001-Update-package-versioning-for-TIS-format.patch
Conflicts:
SPECS/openstack-aodh.spec
Signed-off-by: zhipengl <zhipengs.liu@intel.com>
---
SPECS/openstack-aodh.spec | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/SPECS/openstack-aodh.spec b/SPECS/openstack-aodh.spec
index cac691f..4e626d3 100644
index 9fffb3c..01615e7 100644
--- a/SPECS/openstack-aodh.spec
+++ b/SPECS/openstack-aodh.spec
@@ -4,7 +4,7 @@
Name: openstack-aodh
Version: 5.1.0
-Release: 1%{?dist}
@ -22,6 +21,6 @@ index cac691f..4e626d3 100644
Summary: OpenStack Telemetry Alarming
License: ASL 2.0
URL: https://github.com/openstack/aodh.git
--
2.7.4
--
1.8.3.1

View File

@ -1,69 +0,0 @@
From 8620101244ea5be1ff0cc0e127fa57dca4be468a Mon Sep 17 00:00:00 2001
From: Scott Little <scott.little@windriver.com>
Date: Mon, 2 Oct 2017 14:28:46 -0400
Subject: [PATCH 4/6] WRS: 0001-meta-modify-aodh-api.patch
Conflicts:
SPECS/openstack-aodh.spec
---
SOURCES/openstack-aodh-api.service | 2 +-
SPECS/openstack-aodh.spec | 9 +++++++++
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/SOURCES/openstack-aodh-api.service b/SOURCES/openstack-aodh-api.service
index b8b2921..06bcd12 100644
--- a/SOURCES/openstack-aodh-api.service
+++ b/SOURCES/openstack-aodh-api.service
@@ -5,7 +5,7 @@ After=syslog.target network.target
[Service]
Type=simple
User=root
-ExecStart=/usr/bin/aodh-api
+ExecStart=/bin/python /usr/bin/gunicorn --bind 192.168.204.2:8042 --pythonpath /usr/share/aodh aodh-api
[Install]
WantedBy=multi-user.target
diff --git a/SPECS/openstack-aodh.spec b/SPECS/openstack-aodh.spec
index 8c5722a..4acf6a0 100644
--- a/SPECS/openstack-aodh.spec
+++ b/SPECS/openstack-aodh.spec
@@ -20,6 +20,9 @@ Source14: %{name}-listener.service
#WRS
Source20: aodh-expirer-active
+#WRS: Include patches here:
+Patch1: 0001-modify-aodh-api.patch
+
BuildArch: noarch
BuildRequires: openstack-macros
@@ -214,6 +217,9 @@ This package contains the Aodh test files.
%prep
%setup -q -n %{pypi_name}-%{upstream_version}
+#WRS: Apply patches here
+%patch1 -p1
+
find . \( -name .gitignore -o -name .placeholder \) -delete
find aodh -name \*.py -exec sed -i '/\/usr\/bin\/env python/{d;q}' {} +
@@ -260,6 +266,8 @@ install -d -m 755 %{buildroot}%{_sysconfdir}/aodh
install -p -D -m 640 %{SOURCE1} %{buildroot}%{_datadir}/aodh/aodh-dist.conf
install -p -D -m 640 aodh/aodh.conf %{buildroot}%{_sysconfdir}/aodh/aodh.conf
install -p -D -m 640 aodh/api/policy.json %{buildroot}%{_sysconfdir}/aodh/policy.json
+#WRS
+install -p -D -m 640 aodh/api/aodh-api.py %{buildroot}%{_datadir}/aodh/aodh-api.py
# Setup directories
install -d -m 755 %{buildroot}%{_sharedstatedir}/aodh
@@ -342,6 +350,7 @@ exit 0
%files common -f %{pypi_name}.lang
%doc README.rst
%dir %{_sysconfdir}/aodh
+%{_datadir}/aodh/aodh-api.*
%attr(-, root, aodh) %{_datadir}/aodh/aodh-dist.conf
%config(noreplace) %attr(-, root, aodh) %{_sysconfdir}/aodh/aodh.conf
%config(noreplace) %attr(-, root, aodh) %{_sysconfdir}/aodh/policy.json
--
2.7.4

View File

@ -1,25 +0,0 @@
From 197df524a7d1dfd278e466257b2e4d6edf0191d1 Mon Sep 17 00:00:00 2001
From: Scott Little <scott.little@windriver.com>
Date: Mon, 2 Oct 2017 14:28:46 -0400
Subject: [PATCH 5/6] WRS: 0001-meta-pass-aodh-api-config.patch
---
SOURCES/openstack-aodh-api.service | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/SOURCES/openstack-aodh-api.service b/SOURCES/openstack-aodh-api.service
index 06bcd12..a78eb32 100644
--- a/SOURCES/openstack-aodh-api.service
+++ b/SOURCES/openstack-aodh-api.service
@@ -5,7 +5,7 @@ After=syslog.target network.target
[Service]
Type=simple
User=root
-ExecStart=/bin/python /usr/bin/gunicorn --bind 192.168.204.2:8042 --pythonpath /usr/share/aodh aodh-api
+ExecStart=/bin/python /usr/bin/gunicorn --config /usr/share/aodh/aodh-api.conf --pythonpath /usr/share/aodh aodh-api
[Install]
WantedBy=multi-user.target
--
2.7.4

View File

@ -1,32 +0,0 @@
From 4231d626e3b6fccc3535941baa1a5529a1cac192 Mon Sep 17 00:00:00 2001
From: Al Bailey <Al.Bailey@windriver.com>
Date: Thu, 21 Dec 2017 14:15:48 -0600
Subject: [PATCH 6/6] add drivername for postgresql
---
SPECS/openstack-aodh.spec | 2 ++
1 file changed, 2 insertions(+)
diff --git a/SPECS/openstack-aodh.spec b/SPECS/openstack-aodh.spec
index 4acf6a0..e258fd3 100644
--- a/SPECS/openstack-aodh.spec
+++ b/SPECS/openstack-aodh.spec
@@ -22,6 +22,7 @@ Source20: aodh-expirer-active
#WRS: Include patches here:
Patch1: 0001-modify-aodh-api.patch
+Patch2: 0002-Add-drivername-support-for-postgresql-connection-set.patch
BuildArch: noarch
@@ -219,6 +220,7 @@ This package contains the Aodh test files.
#WRS: Apply patches here
%patch1 -p1
+%patch2 -p1
find . \( -name .gitignore -o -name .placeholder \) -delete
--
2.7.4

View File

@ -1,6 +1,2 @@
0001-Modify-service-files-and-create-expirer-cron-script.patch
0001-Update-package-versioning-for-TIS-format.patch
meta-remove-default-logrotate.patch
0001-meta-modify-aodh-api.patch
0001-meta-pass-aodh-api-config.patch
0006-add-drivername-for-postgresql.patch
spec-include-TiS-patches.patch

View File

@ -1,42 +0,0 @@
From 760b1b7d60d709d20d54d911b992f0e542088f2a Mon Sep 17 00:00:00 2001
From: Scott Little <scott.little@windriver.com>
Date: Mon, 2 Oct 2017 14:28:46 -0400
Subject: [PATCH 3/6] WRS: meta-remove-default-logrotate.patch
---
SPECS/openstack-aodh.spec | 5 -----
1 file changed, 5 deletions(-)
diff --git a/SPECS/openstack-aodh.spec b/SPECS/openstack-aodh.spec
index 4e626d3..8c5722a 100644
--- a/SPECS/openstack-aodh.spec
+++ b/SPECS/openstack-aodh.spec
@@ -11,7 +11,6 @@ URL: https://github.com/openstack/aodh.git
Source0: https://tarballs.openstack.org/%{pypi_name}/%{pypi_name}-%{upstream_version}.tar.gz
Source1: %{pypi_name}-dist.conf
-Source2: %{pypi_name}.logrotate
Source10: %{name}-api.service
Source11: %{name}-evaluator.service
Source12: %{name}-notifier.service
@@ -267,9 +266,6 @@ install -d -m 755 %{buildroot}%{_sharedstatedir}/aodh
install -d -m 755 %{buildroot}%{_sharedstatedir}/aodh/tmp
install -d -m 755 %{buildroot}%{_localstatedir}/log/aodh
-# Install logrotate
-install -p -D -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
-
# Install systemd unit services
install -p -D -m 644 %{SOURCE10} %{buildroot}%{_unitdir}/%{name}-api.service
install -p -D -m 644 %{SOURCE11} %{buildroot}%{_unitdir}/%{name}-evaluator.service
@@ -349,7 +345,6 @@ exit 0
%attr(-, root, aodh) %{_datadir}/aodh/aodh-dist.conf
%config(noreplace) %attr(-, root, aodh) %{_sysconfdir}/aodh/aodh.conf
%config(noreplace) %attr(-, root, aodh) %{_sysconfdir}/aodh/policy.json
-%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
%dir %attr(0750, aodh, root) %{_localstatedir}/log/aodh
%{_bindir}/aodh-config-generator
--
2.7.4

View File

@ -0,0 +1,75 @@
From 8620101244ea5be1ff0cc0e127fa57dca4be468a Mon Sep 17 00:00:00 2001
From: Scott Little <scott.little@windriver.com>
Date: Mon, 2 Oct 2017 14:28:46 -0400
Subject: [PATCH] WRS: spec-include-TiS-patches.patch
Signed-off-by: zhipengl <zhipengs.liu@intel.com>
---
SPECS/openstack-aodh.spec | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/SPECS/openstack-aodh.spec b/SPECS/openstack-aodh.spec
index 01615e7..f840861 100644
--- a/SPECS/openstack-aodh.spec
+++ b/SPECS/openstack-aodh.spec
@@ -18,6 +18,9 @@ Source12: %{name}-notifier.service
Source13: %{name}-expirer.service
Source14: %{name}-listener.service
+#WRS: Include patches here:
+Patch1: 0001-modify-aodh-api.patch
+Patch2: 0002-Add-drivername-support-for-postgresql-connection-set.patch
BuildArch: noarch
BuildRequires: openstack-macros
@@ -212,6 +215,10 @@ This package contains the Aodh test files.
%prep
%setup -q -n %{pypi_name}-%{upstream_version}
+#WRS: Apply patches here
+%patch1 -p1
+%patch2 -p1
+
find . \( -name .gitignore -o -name .placeholder \) -delete
find aodh -name \*.py -exec sed -i '/\/usr\/bin\/env python/{d;q}' {} +
@@ -259,10 +266,12 @@ install -p -D -m 640 %{SOURCE1} %{buildroot}%{_datadir}/aodh/aodh-dist.conf
install -p -D -m 640 aodh/aodh.conf %{buildroot}%{_sysconfdir}/aodh/aodh.conf
install -p -D -m 640 aodh/api/policy.json %{buildroot}%{_sysconfdir}/aodh/policy.json
+#WRS
+install -p -D -m 640 aodh/api/aodh-api.py %{buildroot}%{_datadir}/aodh/aodh-api.py
# Setup directories
install -d -m 755 %{buildroot}%{_sharedstatedir}/aodh
install -d -m 755 %{buildroot}%{_sharedstatedir}/aodh/tmp
-install -d -m 750 %{buildroot}%{_localstatedir}/log/aodh
+install -d -m 755 %{buildroot}%{_localstatedir}/log/aodh
# Install logrotate
install -p -D -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
@@ -340,12 +349,12 @@ exit 0
%files common -f %{pypi_name}.lang
%doc README.rst
%dir %{_sysconfdir}/aodh
+%{_datadir}/aodh/aodh-api.*
%attr(-, root, aodh) %{_datadir}/aodh/aodh-dist.conf
%config(noreplace) %attr(-, root, aodh) %{_sysconfdir}/aodh/aodh.conf
%config(noreplace) %attr(-, root, aodh) %{_sysconfdir}/aodh/policy.json
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
-%dir %attr(0750, aodh, root) %{_localstatedir}/log/aodh
-%{_bindir}/aodh-dbsync
+%dir %attr(0755, aodh, root) %{_localstatedir}/log/aodh
%{_bindir}/aodh-config-generator
%defattr(-, aodh, aodh, -)
@@ -353,6 +362,7 @@ exit 0
%dir %{_sharedstatedir}/aodh/tmp
%files api
+%{_bindir}/aodh-dbsync
%{_bindir}/aodh-api
%{_unitdir}/%{name}-api.service
--
2.7.4