From 7d1e7920abf893cae4e94417592ad3ab593984cf Mon Sep 17 00:00:00 2001 From: Jeff Peeler Date: Wed, 26 Sep 2012 11:25:40 -0400 Subject: [PATCH 1/6] Add patch to make use of glanceclient if available Signed-off-by: Jeff Peeler --- heat.spec | 4 +++ import-glanceclient.patch | 53 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 import-glanceclient.patch diff --git a/heat.spec b/heat.spec index 2eb93e4..4844d5b 100644 --- a/heat.spec +++ b/heat.spec @@ -13,6 +13,8 @@ Source4: heat-metadata.service Source5: heat-api-cloudwatch.service Patch0: switch-to-using-m2crypto.patch +# Patch1 to stay until v7 released +Patch1: import-glanceclient.patch BuildArch: noarch BuildRequires: python2-devel @@ -46,6 +48,7 @@ Requires(pre): shadow-utils %prep %setup -q %patch0 -p1 +%patch1 -p1 %build %{__python} setup.py build @@ -131,6 +134,7 @@ exit 0 %changelog * Wed Sep 26 2012 Jeff Peeler 6-4 - switch requires to python-glanceclient +- add patch to make use of new import * Tue Sep 25 2012 Jeff Peeler 6-3 - change systemd scripts to use openstack-heat user diff --git a/import-glanceclient.patch b/import-glanceclient.patch new file mode 100644 index 0000000..03d3f12 --- /dev/null +++ b/import-glanceclient.patch @@ -0,0 +1,53 @@ +From d9f63269f1a0205811cd84487787c8c1291a952b Mon Sep 17 00:00:00 2001 +From: Steven Hardy +Date: Wed, 26 Sep 2012 14:51:08 +0100 +Subject: [PATCH] heat : fix glanceclient deprecation warning + +glanceclient module name changed for F18, so do +a conditional import which should import the correct +version provided one is available (tested on F17/F18) + +Fixes #251 + +Change-Id: I095560f29a408949a7d54795fc000c094b1d63b9 +Signed-off-by: Steven Hardy +--- + heat/tests/functional/util.py | 5 ++++- + heat/utils.py | 5 ++++- + 2 files changed, 8 insertions(+), 2 deletions(-) + +diff --git a/heat/tests/functional/util.py b/heat/tests/functional/util.py +index b9f6e06..bb88ec1 100644 +--- a/heat/tests/functional/util.py ++++ b/heat/tests/functional/util.py +@@ -33,7 +33,10 @@ from nose.plugins.attrib import attr + from nose import with_setup + from nose.exc import SkipTest + +-from glance import client as glance_client ++try: ++ from glanceclient import client as glance_client ++except ImportError: ++ from glance import client as glance_client + from novaclient.v1_1 import client as nova_client + import heat + from heat import utils +diff --git a/heat/utils.py b/heat/utils.py +index 528b40d..bc39b6c 100644 +--- a/heat/utils.py ++++ b/heat/utils.py +@@ -21,7 +21,10 @@ import base64 + from lxml import etree + import re + +-from glance import client as glance_client ++try: ++ from glanceclient import client as glance_client ++except ImportError: ++ from glance import client as glance_client + from heat.common import exception + + from heat.openstack.common import log as logging +-- +1.7.11.4 + From 2a98fe474fb1a202a22097737a07ef908099996f Mon Sep 17 00:00:00 2001 From: Jeff Peeler Date: Wed, 26 Sep 2012 12:57:21 -0400 Subject: [PATCH 2/6] Make f18 branch match master to make merging easier Signed-off-by: Jeff Peeler --- ... => heat-fix-glanceclient-deprecation-warning.patch | 0 heat.spec | 10 +++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) rename import-glanceclient.patch => heat-fix-glanceclient-deprecation-warning.patch (100%) diff --git a/import-glanceclient.patch b/heat-fix-glanceclient-deprecation-warning.patch similarity index 100% rename from import-glanceclient.patch rename to heat-fix-glanceclient-deprecation-warning.patch diff --git a/heat.spec b/heat.spec index 4844d5b..1c27f6d 100644 --- a/heat.spec +++ b/heat.spec @@ -1,7 +1,7 @@ Name: heat Summary: This software provides AWS CloudFormation functionality for OpenStack Essex Version: 6 -Release: 4%{?dist} +Release: 5%{?dist} License: ASL 2.0 Group: System Environment/Base URL: http://heat-api.org @@ -14,7 +14,7 @@ Source5: heat-api-cloudwatch.service Patch0: switch-to-using-m2crypto.patch # Patch1 to stay until v7 released -Patch1: import-glanceclient.patch +Patch1: heat-fix-glanceclient-deprecation-warning.patch BuildArch: noarch BuildRequires: python2-devel @@ -132,9 +132,13 @@ exit 0 %systemd_postun_with_restart heat-api-cloudwatch.service %changelog +* Wed Sep 26 2012 Steven Dake 6-5 +- Merge upstream commit d9f63269f1a0205811cd84487787c8c1291a952b +- Resolves: RHBZ#860726 +- fix "heat cli prints warning on each operation" + * Wed Sep 26 2012 Jeff Peeler 6-4 - switch requires to python-glanceclient -- add patch to make use of new import * Tue Sep 25 2012 Jeff Peeler 6-3 - change systemd scripts to use openstack-heat user From 354c5ed63aa60a7dd5a5a78e59a2aae09495ff58 Mon Sep 17 00:00:00 2001 From: Steven Dake Date: Wed, 26 Sep 2012 08:12:49 -0700 Subject: [PATCH 3/6] Resolves: RHBZ#860726 Signed-off-by: Steven Dake --- heat.spec | 1 - 1 file changed, 1 deletion(-) diff --git a/heat.spec b/heat.spec index 1c27f6d..c4c30a5 100644 --- a/heat.spec +++ b/heat.spec @@ -13,7 +13,6 @@ Source4: heat-metadata.service Source5: heat-api-cloudwatch.service Patch0: switch-to-using-m2crypto.patch -# Patch1 to stay until v7 released Patch1: heat-fix-glanceclient-deprecation-warning.patch BuildArch: noarch From 8e4cdf6343c566d6d1aa272645112b171ab16f1f Mon Sep 17 00:00:00 2001 From: Steven Dake Date: Wed, 26 Sep 2012 10:52:40 -0700 Subject: [PATCH 4/6] Resolves: RHBZ#860105 Signed-off-by: Steven Dake --- ...cific-heat-keystone-setup-binary-to-.patch | 92 +++++++++++++++++++ heat.spec | 9 +- 2 files changed, 100 insertions(+), 1 deletion(-) create mode 100644 Add-a-Folsom-specific-heat-keystone-setup-binary-to-.patch diff --git a/Add-a-Folsom-specific-heat-keystone-setup-binary-to-.patch b/Add-a-Folsom-specific-heat-keystone-setup-binary-to-.patch new file mode 100644 index 0000000..3c995e1 --- /dev/null +++ b/Add-a-Folsom-specific-heat-keystone-setup-binary-to-.patch @@ -0,0 +1,92 @@ +From 5208008db047d8cda231100db817c6f0e1c190a5 Mon Sep 17 00:00:00 2001 +From: Steven Dake +Date: Wed, 26 Sep 2012 10:08:05 -0700 +Subject: [PATCH] Add a Folsom specific heat-keystone-setup binary to bin + +Fixes issue #253 + +Change-Id: Ie223c43c15ac806da393e3d532ef410526ac16ce +Signed-off-by: Steven Dake +--- + bin/heat-keystone-setup | 56 +++++++++++++++++++++++++++++++++++++++++++++++++ + setup.py | 3 ++- + 2 files changed, 58 insertions(+), 1 deletion(-) + create mode 100755 bin/heat-keystone-setup + +diff --git a/bin/heat-keystone-setup b/bin/heat-keystone-setup +new file mode 100755 +index 0000000..0c3d688 +--- /dev/null ++++ b/bin/heat-keystone-setup +@@ -0,0 +1,56 @@ ++#!/bin/bash ++ ++set +e ++ ++function get_id () { ++ echo `"$@" | grep ' id ' | awk '{print $4}'` ++} ++ ++KEYSTONE_CONF=${KEYSTONE_CONF:-/etc/keystone/keystone.conf} ++ ++# Extract some info from Keystone's configuration file ++if [[ -r "$KEYSTONE_CONF" ]]; then ++ CONFIG_SERVICE_TOKEN=$(sed 's/[[:space:]]//g' $KEYSTONE_CONF | grep ^admin_token= | cut -d'=' -f2) ++ CONFIG_ADMIN_PORT=$(sed 's/[[:space:]]//g' $KEYSTONE_CONF | grep ^admin_port= | cut -d'=' -f2) ++fi ++ ++export SERVICE_TOKEN=${SERVICE_TOKEN:-$CONFIG_SERVICE_TOKEN} ++export SERVICE_ENDPOINT=${SERVICE_ENDPOINT:-http://127.0.0.1:${CONFIG_ADMIN_PORT:-35357}/v2.0} ++if [[ -z "$SERVICE_TOKEN" ]]; then ++ echo "No service token found." ++ echo "Set SERVICE_TOKEN manually from keystone.conf admin_token." ++ exit 1 ++fi ++ ++ADMIN_ROLE=$(keystone role-list | grep '\badmin\b' | awk '{ print $2 }') ++SERVICE_TENANT=$(keystone tenant-list | grep service | cut -d\| -f2) ++SERVICE_PASSWORD=${SERVICE_PASSWORD:-$OS_PASSWORD} ++if [[ "$SERVICE_PASSWORD" == "$OS_PASSWORD" ]]; then ++ echo "Using the OS_PASSWORD for the SERVICE_PASSWORD." ++fi ++ ++echo ADMIN_ROLE $ADMIN_ROLE ++echo SERVICE_TENANT $SERVICE_TENANT ++echo SERVICE_PASSWORD $SERVICE_PASSWORD ++echo SERVICE_TOKEN $SERVICE_TOKEN ++ ++ ++# Services ++HEAT_SERVICE=$(get_id \ ++keystone service-create --name=heat \ ++ --type=orchestration \ ++ --description="Heat Service") ++HEAT_USER=$(get_id keystone user-create --name=heat \ ++ --pass="$SERVICE_PASSWORD" \ ++ --tenant_id $SERVICE_TENANT \ ++ --email=heat@example.com) ++echo HEAT_USER $HEAT_USER ++keystone user-role-add --tenant_id $SERVICE_TENANT \ ++ --user_id $HEAT_USER \ ++ --role_id $ADMIN_ROLE ++ ++keystone endpoint-create --region RegionOne --service_id $HEAT_SERVICE \ ++ --publicurl 'http://localhost:8000/v1' \ ++ --adminurl 'http://localhost:8000/v1' \ ++ --internalurl 'http://localhost:8000/v1' ++ +diff --git a/setup.py b/setup.py +index be3ece1..360eb4a 100755 +--- a/setup.py ++++ b/setup.py +@@ -50,5 +50,6 @@ setuptools.setup( + 'bin/heat-metadata', + 'bin/heat-engine', + 'bin/heat-watch', +- 'bin/heat-db-setup'], ++ 'bin/heat-db-setup', ++ 'bin/heat-keystone-setup'], + py_modules=[]) +-- +1.7.11.4 + diff --git a/heat.spec b/heat.spec index c4c30a5..7b023d8 100644 --- a/heat.spec +++ b/heat.spec @@ -1,7 +1,7 @@ Name: heat Summary: This software provides AWS CloudFormation functionality for OpenStack Essex Version: 6 -Release: 5%{?dist} +Release: 6%{?dist} License: ASL 2.0 Group: System Environment/Base URL: http://heat-api.org @@ -14,6 +14,7 @@ Source5: heat-api-cloudwatch.service Patch0: switch-to-using-m2crypto.patch Patch1: heat-fix-glanceclient-deprecation-warning.patch +Patch2: Add-a-Folsom-specific-heat-keystone-setup-binary-to-.patch BuildArch: noarch BuildRequires: python2-devel @@ -48,6 +49,7 @@ Requires(pre): shadow-utils %setup -q %patch0 -p1 %patch1 -p1 +%patch2 -p1 %build %{__python} setup.py build @@ -131,6 +133,11 @@ exit 0 %systemd_postun_with_restart heat-api-cloudwatch.service %changelog +* Wed Sep 26 2012 Steven Dake 6-6 +- Merge upstream commit 5208008db047d8cda231100db817c6f0e1c190a5 +- Resolves: RHBZ#860105 +- fix "heat-keystone-setup not available in heat rpm" + * Wed Sep 26 2012 Steven Dake 6-5 - Merge upstream commit d9f63269f1a0205811cd84487787c8c1291a952b - Resolves: RHBZ#860726 From e5efa97b73604986a5ab966f22f73f2b1dd1db5d Mon Sep 17 00:00:00 2001 From: Zane Bitter Date: Fri, 26 Oct 2012 13:26:57 +0200 Subject: [PATCH 5/6] Rebase to v7 --- .gitignore | 1 + ...cific-heat-keystone-setup-binary-to-.patch | 92 ------------------- heat-api.service | 12 +++ ...fix-glanceclient-deprecation-warning.patch | 53 ----------- heat.spec | 29 ++++-- sources | 3 +- switch-to-using-m2crypto.patch | 17 ++-- 7 files changed, 40 insertions(+), 167 deletions(-) delete mode 100644 Add-a-Folsom-specific-heat-keystone-setup-binary-to-.patch create mode 100644 heat-api.service delete mode 100644 heat-fix-glanceclient-deprecation-warning.patch diff --git a/.gitignore b/.gitignore index 577463f..36e3382 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /heat-4.tar.gz /heat-5.tar.gz /heat-6.tar.gz +/heat-7.tar.gz diff --git a/Add-a-Folsom-specific-heat-keystone-setup-binary-to-.patch b/Add-a-Folsom-specific-heat-keystone-setup-binary-to-.patch deleted file mode 100644 index 3c995e1..0000000 --- a/Add-a-Folsom-specific-heat-keystone-setup-binary-to-.patch +++ /dev/null @@ -1,92 +0,0 @@ -From 5208008db047d8cda231100db817c6f0e1c190a5 Mon Sep 17 00:00:00 2001 -From: Steven Dake -Date: Wed, 26 Sep 2012 10:08:05 -0700 -Subject: [PATCH] Add a Folsom specific heat-keystone-setup binary to bin - -Fixes issue #253 - -Change-Id: Ie223c43c15ac806da393e3d532ef410526ac16ce -Signed-off-by: Steven Dake ---- - bin/heat-keystone-setup | 56 +++++++++++++++++++++++++++++++++++++++++++++++++ - setup.py | 3 ++- - 2 files changed, 58 insertions(+), 1 deletion(-) - create mode 100755 bin/heat-keystone-setup - -diff --git a/bin/heat-keystone-setup b/bin/heat-keystone-setup -new file mode 100755 -index 0000000..0c3d688 ---- /dev/null -+++ b/bin/heat-keystone-setup -@@ -0,0 +1,56 @@ -+#!/bin/bash -+ -+set +e -+ -+function get_id () { -+ echo `"$@" | grep ' id ' | awk '{print $4}'` -+} -+ -+KEYSTONE_CONF=${KEYSTONE_CONF:-/etc/keystone/keystone.conf} -+ -+# Extract some info from Keystone's configuration file -+if [[ -r "$KEYSTONE_CONF" ]]; then -+ CONFIG_SERVICE_TOKEN=$(sed 's/[[:space:]]//g' $KEYSTONE_CONF | grep ^admin_token= | cut -d'=' -f2) -+ CONFIG_ADMIN_PORT=$(sed 's/[[:space:]]//g' $KEYSTONE_CONF | grep ^admin_port= | cut -d'=' -f2) -+fi -+ -+export SERVICE_TOKEN=${SERVICE_TOKEN:-$CONFIG_SERVICE_TOKEN} -+export SERVICE_ENDPOINT=${SERVICE_ENDPOINT:-http://127.0.0.1:${CONFIG_ADMIN_PORT:-35357}/v2.0} -+if [[ -z "$SERVICE_TOKEN" ]]; then -+ echo "No service token found." -+ echo "Set SERVICE_TOKEN manually from keystone.conf admin_token." -+ exit 1 -+fi -+ -+ADMIN_ROLE=$(keystone role-list | grep '\badmin\b' | awk '{ print $2 }') -+SERVICE_TENANT=$(keystone tenant-list | grep service | cut -d\| -f2) -+SERVICE_PASSWORD=${SERVICE_PASSWORD:-$OS_PASSWORD} -+if [[ "$SERVICE_PASSWORD" == "$OS_PASSWORD" ]]; then -+ echo "Using the OS_PASSWORD for the SERVICE_PASSWORD." -+fi -+ -+echo ADMIN_ROLE $ADMIN_ROLE -+echo SERVICE_TENANT $SERVICE_TENANT -+echo SERVICE_PASSWORD $SERVICE_PASSWORD -+echo SERVICE_TOKEN $SERVICE_TOKEN -+ -+ -+# Services -+HEAT_SERVICE=$(get_id \ -+keystone service-create --name=heat \ -+ --type=orchestration \ -+ --description="Heat Service") -+HEAT_USER=$(get_id keystone user-create --name=heat \ -+ --pass="$SERVICE_PASSWORD" \ -+ --tenant_id $SERVICE_TENANT \ -+ --email=heat@example.com) -+echo HEAT_USER $HEAT_USER -+keystone user-role-add --tenant_id $SERVICE_TENANT \ -+ --user_id $HEAT_USER \ -+ --role_id $ADMIN_ROLE -+ -+keystone endpoint-create --region RegionOne --service_id $HEAT_SERVICE \ -+ --publicurl 'http://localhost:8000/v1' \ -+ --adminurl 'http://localhost:8000/v1' \ -+ --internalurl 'http://localhost:8000/v1' -+ -diff --git a/setup.py b/setup.py -index be3ece1..360eb4a 100755 ---- a/setup.py -+++ b/setup.py -@@ -50,5 +50,6 @@ setuptools.setup( - 'bin/heat-metadata', - 'bin/heat-engine', - 'bin/heat-watch', -- 'bin/heat-db-setup'], -+ 'bin/heat-db-setup', -+ 'bin/heat-keystone-setup'], - py_modules=[]) --- -1.7.11.4 - diff --git a/heat-api.service b/heat-api.service new file mode 100644 index 0000000..a08a3e2 --- /dev/null +++ b/heat-api.service @@ -0,0 +1,12 @@ +[Unit] +Description=The Heat API provides an OpenStack-native ReST API to the Heat Engine for starting AWS CloudFormation templates on OpenStack. +After=syslog.target network.target heat-engine.service +Requires=syslog.target network.target heat-engine.service + +[Service] +ExecStart=/usr/bin/heat-api +Restart=on-failure +User=openstack-heat + +[Install] +WantedBy=multi-user.target diff --git a/heat-fix-glanceclient-deprecation-warning.patch b/heat-fix-glanceclient-deprecation-warning.patch deleted file mode 100644 index 03d3f12..0000000 --- a/heat-fix-glanceclient-deprecation-warning.patch +++ /dev/null @@ -1,53 +0,0 @@ -From d9f63269f1a0205811cd84487787c8c1291a952b Mon Sep 17 00:00:00 2001 -From: Steven Hardy -Date: Wed, 26 Sep 2012 14:51:08 +0100 -Subject: [PATCH] heat : fix glanceclient deprecation warning - -glanceclient module name changed for F18, so do -a conditional import which should import the correct -version provided one is available (tested on F17/F18) - -Fixes #251 - -Change-Id: I095560f29a408949a7d54795fc000c094b1d63b9 -Signed-off-by: Steven Hardy ---- - heat/tests/functional/util.py | 5 ++++- - heat/utils.py | 5 ++++- - 2 files changed, 8 insertions(+), 2 deletions(-) - -diff --git a/heat/tests/functional/util.py b/heat/tests/functional/util.py -index b9f6e06..bb88ec1 100644 ---- a/heat/tests/functional/util.py -+++ b/heat/tests/functional/util.py -@@ -33,7 +33,10 @@ from nose.plugins.attrib import attr - from nose import with_setup - from nose.exc import SkipTest - --from glance import client as glance_client -+try: -+ from glanceclient import client as glance_client -+except ImportError: -+ from glance import client as glance_client - from novaclient.v1_1 import client as nova_client - import heat - from heat import utils -diff --git a/heat/utils.py b/heat/utils.py -index 528b40d..bc39b6c 100644 ---- a/heat/utils.py -+++ b/heat/utils.py -@@ -21,7 +21,10 @@ import base64 - from lxml import etree - import re - --from glance import client as glance_client -+try: -+ from glanceclient import client as glance_client -+except ImportError: -+ from glance import client as glance_client - from heat.common import exception - - from heat.openstack.common import log as logging --- -1.7.11.4 - diff --git a/heat.spec b/heat.spec index 7b023d8..c92a0b9 100644 --- a/heat.spec +++ b/heat.spec @@ -1,20 +1,19 @@ Name: heat Summary: This software provides AWS CloudFormation functionality for OpenStack Essex -Version: 6 -Release: 6%{?dist} +Version: 7 +Release: 1%{?dist} License: ASL 2.0 Group: System Environment/Base URL: http://heat-api.org Source0: https://github.com/downloads/heat-api/heat/heat-%{version}.tar.gz Source1: heat.logrotate -Source2: heat-api-cfn.service -Source3: heat-engine.service -Source4: heat-metadata.service -Source5: heat-api-cloudwatch.service +Source2: heat-api.service +Source3: heat-api-cfn.service +Source4: heat-engine.service +Source5: heat-metadata.service +Source6: heat-api-cloudwatch.service Patch0: switch-to-using-m2crypto.patch -Patch1: heat-fix-glanceclient-deprecation-warning.patch -Patch2: Add-a-Folsom-specific-heat-keystone-setup-binary-to-.patch BuildArch: noarch BuildRequires: python2-devel @@ -48,8 +47,6 @@ Requires(pre): shadow-utils %prep %setup -q %patch0 -p1 -%patch1 -p1 -%patch2 -p1 %build %{__python} setup.py build @@ -63,6 +60,7 @@ mkdir -p %{buildroot}/var/log/heat/ install -p -D -m 644 %{SOURCE1} %{buildroot}%{_sysconfdir}/logrotate.d/heat # install systemd unit files +install -p -D -m 644 %{SOURCE2} %{buildroot}%{_unitdir}/heat-api.service install -p -D -m 644 %{SOURCE2} %{buildroot}%{_unitdir}/heat-api-cfn.service install -p -D -m 644 %{SOURCE3} %{buildroot}%{_unitdir}/heat-engine.service install -p -D -m 644 %{SOURCE4} %{buildroot}%{_unitdir}/heat-metadata.service @@ -74,6 +72,8 @@ mkdir -p %{buildroot}/%{_mandir}/man1/ cp -v docs/man/man1/* %{buildroot}/%{_mandir}/man1/ rm -rf %{buildroot}/var/lib/heat/.dummy +install -p -D -m 644 %{_builddir}/%{name}-%{version}/etc/heat/heat-api.conf %{buildroot}/%{_sysconfdir}/heat +install -p -D -m 644 %{_builddir}/%{name}-%{version}/etc/heat/heat-api-paste.ini %{buildroot}/%{_sysconfdir}/heat install -p -D -m 644 %{_builddir}/%{name}-%{version}/etc/heat/heat-api-cfn.conf %{buildroot}/%{_sysconfdir}/heat install -p -D -m 644 %{_builddir}/%{name}-%{version}/etc/heat/heat-api-cfn-paste.ini %{buildroot}/%{_sysconfdir}/heat install -p -D -m 644 %{_builddir}/%{name}-%{version}/etc/heat/heat-api-cloudwatch.conf %{buildroot}/%{_sysconfdir}/heat @@ -98,6 +98,8 @@ Heat provides AWS CloudFormation and CloudWatch functionality for OpenStack. %dir %{_sysconfdir}/heat %config(noreplace) %{_sysconfdir}/logrotate.d/heat %config(noreplace) %{_sysconfdir}/bash_completion.d/heat +%config(noreplace) %attr(-,root,openstack-heat) %{_sysconfdir}/heat/heat-api.conf +%config(noreplace) %attr(-,root,openstack-heat) %{_sysconfdir}/heat/heat-api-paste.ini %config(noreplace) %attr(-,root,openstack-heat) %{_sysconfdir}/heat/heat-api-cfn.conf %config(noreplace) %attr(-,root,openstack-heat) %{_sysconfdir}/heat/heat-api-cfn-paste.ini %config(noreplace) %attr(-,root,openstack-heat) %{_sysconfdir}/heat/heat-api-cloudwatch.conf @@ -115,24 +117,31 @@ useradd -u 187 -r -g openstack-heat -d %{_localstatedir}/lib/heat -s /sbin/nolog exit 0 %post +%systemd_post heat-api.service %systemd_post heat-api-cfn.service %systemd_post heat-engine.service %systemd_post heat-metadata.service %systemd_post heat-api-cloudwatch.service %preun +%systemd_preun heat-api.service %systemd_preun heat-api-cfn.service %systemd_preun heat-engine.service %systemd_preun heat-engine.service %systemd_preun heat-api-cloudwatch.service %postun +%systemd_postun_with_restart heat-api.service %systemd_postun_with_restart heat-api-cfn.service %systemd_postun_with_restart heat-engine-cfn.service %systemd_postun_with_restart heat-metadata.service %systemd_postun_with_restart heat-api-cloudwatch.service %changelog +* Fri Oct 26 2012 Zane Bitter 7-1 +- rebase to v7 +- add heat-api daemon (OpenStack-native API) + * Wed Sep 26 2012 Steven Dake 6-6 - Merge upstream commit 5208008db047d8cda231100db817c6f0e1c190a5 - Resolves: RHBZ#860105 diff --git a/sources b/sources index 9dcb85f..422d448 100644 --- a/sources +++ b/sources @@ -1,2 +1 @@ -26223425612fb858141ee90eded9d793 heat-5.tar.gz -25de983ccef24da45c02dbc1a829a9c5 heat-6.tar.gz +85337c5b5c7e66561c8f1faf404310d6 heat-7.tar.gz diff --git a/switch-to-using-m2crypto.patch b/switch-to-using-m2crypto.patch index b83d61a..fa55d5e 100644 --- a/switch-to-using-m2crypto.patch +++ b/switch-to-using-m2crypto.patch @@ -1,4 +1,4 @@ -From 05ce67d3842b09943b21e7e72eff1849bc1b32b7 Mon Sep 17 00:00:00 2001 +From 38c97efe5c3e8e2d732f82dcf83cc74ea55dbe4e Mon Sep 17 00:00:00 2001 From: Ian Main Date: Fri, 27 Jul 2012 08:43:10 -0700 Subject: [PATCH] Switch to using M2Crypto @@ -9,12 +9,12 @@ and decryption of user authentication information. Change-Id: Ib40492d4d40a92bf0167c249b15458c89af4716e Signed-off-by: Ian Main --- - heat/engine/auth.py | 22 ++++++++++++---------- - tools/pip-requires | 2 +- + heat/engine/auth.py | 22 ++++++++++++---------- + tools/pip-requires | 2 +- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/heat/engine/auth.py b/heat/engine/auth.py -index a4be7ef..5d16f84 100644 +index 1b1a11c..a90c6b7 100644 --- a/heat/engine/auth.py +++ b/heat/engine/auth.py @@ -24,8 +24,8 @@ from novaclient.exceptions import AuthorizationFailure @@ -28,7 +28,7 @@ index a4be7ef..5d16f84 100644 from heat.openstack.common import cfg from heat.openstack.common import importutils -@@ -45,20 +45,22 @@ logger = logging.getLogger('heat.engine.auth') +@@ -45,17 +45,19 @@ logger = logging.getLogger('heat.engine.auth') def encrypt(auth_info): if auth_info is None: return None @@ -56,11 +56,8 @@ index a4be7ef..5d16f84 100644 + key=cfg.CONF.auth_encryption_key, iv=iv, + op=0) # 0 is decode + return cipher.update(auth[16:]) + cipher.final() - - - def authenticate(con, service_type='orchestration', service_name='heat'): diff --git a/tools/pip-requires b/tools/pip-requires -index 1fcfdf3..4efd475 100644 +index 092419d..085567e 100644 --- a/tools/pip-requires +++ b/tools/pip-requires @@ -9,7 +9,7 @@ @@ -73,5 +70,5 @@ index 1fcfdf3..4efd475 100644 greenlet httplib2 -- -1.7.10.4 +1.7.11.7 From 4ad04fd5bebf3e541664f371abbdbf6d55aeb7f4 Mon Sep 17 00:00:00 2001 From: Jeff Peeler Date: Tue, 28 May 2013 23:16:41 -0400 Subject: [PATCH 6/6] Fix requires and add group openstack-heat transition changed require from python-paste to python-paste-deploy (rhbz#963207) changed UID/GID back again to heat instead of openstack-heat added group/user rename for old installs changed systemd scripts to match heat user Resolves: rhbz#963207 Conflicts: heat.spec --- heat-api-cfn.service | 2 +- heat-api-cloudwatch.service | 2 +- heat-api.service | 2 +- heat-engine.service | 2 +- heat-metadata.service | 2 +- heat.spec | 49 +++++++++++++++++++++++-------------- 6 files changed, 36 insertions(+), 23 deletions(-) diff --git a/heat-api-cfn.service b/heat-api-cfn.service index e00f8f2..f46cd28 100644 --- a/heat-api-cfn.service +++ b/heat-api-cfn.service @@ -6,7 +6,7 @@ Requires=syslog.target network.target heat-engine.service [Service] ExecStart=/usr/bin/heat-api-cfn Restart=on-failure -User=openstack-heat +User=heat [Install] WantedBy=multi-user.target diff --git a/heat-api-cloudwatch.service b/heat-api-cloudwatch.service index bfc0877..840f1a6 100644 --- a/heat-api-cloudwatch.service +++ b/heat-api-cloudwatch.service @@ -6,7 +6,7 @@ Requires=syslog.target network.target heat-engine.service [Service] ExecStart=/usr/bin/heat-api-cloudwatch Restart=on-failure -User=openstack-heat +User=heat [Install] WantedBy=multi-user.target diff --git a/heat-api.service b/heat-api.service index a08a3e2..8fb5fdb 100644 --- a/heat-api.service +++ b/heat-api.service @@ -6,7 +6,7 @@ Requires=syslog.target network.target heat-engine.service [Service] ExecStart=/usr/bin/heat-api Restart=on-failure -User=openstack-heat +User=heat [Install] WantedBy=multi-user.target diff --git a/heat-engine.service b/heat-engine.service index a5e2359..de0d986 100644 --- a/heat-engine.service +++ b/heat-engine.service @@ -6,7 +6,7 @@ Requires=syslog.target network.target qpidd.service mysqld.service openstack-key [Service] ExecStart=/usr/bin/heat-engine Restart=on-failure -User=openstack-heat +User=heat [Install] WantedBy=multi-user.target diff --git a/heat-metadata.service b/heat-metadata.service index bc4efb3..8c7cbb1 100644 --- a/heat-metadata.service +++ b/heat-metadata.service @@ -6,7 +6,7 @@ Requires=syslog.target network.target heat-engine.service [Service] ExecStart=/usr/bin/heat-metadata Restart=on-failure -User=openstack-heat +User=heat [Install] WantedBy=multi-user.target diff --git a/heat.spec b/heat.spec index c92a0b9..4d7f64f 100644 --- a/heat.spec +++ b/heat.spec @@ -1,7 +1,7 @@ Name: heat Summary: This software provides AWS CloudFormation functionality for OpenStack Essex Version: 7 -Release: 1%{?dist} +Release: 2%{?dist} License: ASL 2.0 Group: System Environment/Base URL: http://heat-api.org @@ -31,7 +31,7 @@ Requires: python-lxml Requires: python-memcached Requires: python-migrate Requires: python-novaclient -Requires: python-paste +Requires: python-paste-deploy Requires: python-qpid Requires: python-routes Requires: pysendfile @@ -92,28 +92,35 @@ Heat provides AWS CloudFormation and CloudWatch functionality for OpenStack. %{_mandir}/man1/*.gz %{_bindir}/* %{python_sitelib}/heat* -%dir %attr(0755,openstack-heat,root) %{_localstatedir}/log/heat -%dir %attr(0755,openstack-heat,root) %{_localstatedir}/lib/heat +%dir %attr(0755,heat,root) %{_localstatedir}/log/heat +%dir %attr(0755,heat,root) %{_localstatedir}/lib/heat %{_unitdir}/heat*.service %dir %{_sysconfdir}/heat %config(noreplace) %{_sysconfdir}/logrotate.d/heat %config(noreplace) %{_sysconfdir}/bash_completion.d/heat -%config(noreplace) %attr(-,root,openstack-heat) %{_sysconfdir}/heat/heat-api.conf -%config(noreplace) %attr(-,root,openstack-heat) %{_sysconfdir}/heat/heat-api-paste.ini -%config(noreplace) %attr(-,root,openstack-heat) %{_sysconfdir}/heat/heat-api-cfn.conf -%config(noreplace) %attr(-,root,openstack-heat) %{_sysconfdir}/heat/heat-api-cfn-paste.ini -%config(noreplace) %attr(-,root,openstack-heat) %{_sysconfdir}/heat/heat-api-cloudwatch.conf -%config(noreplace) %attr(-,root,openstack-heat) %{_sysconfdir}/heat/heat-api-cloudwatch-paste.ini -%config(noreplace) %attr(-,root,openstack-heat) %{_sysconfdir}/heat/heat-engine.conf -%config(noreplace) %attr(-,root,openstack-heat) %{_sysconfdir}/heat/heat-metadata.conf -%config(noreplace) %attr(-,root,openstack-heat) %{_sysconfdir}/heat/heat-metadata-paste.ini -%config(noreplace) %attr(-,root,openstack-heat) %{_sysconfdir}/heat/boto.cfg +%config(noreplace) %attr(-,root,heat) %{_sysconfdir}/heat/heat-api.conf +%config(noreplace) %attr(-,root,heat) %{_sysconfdir}/heat/heat-api-paste.ini +%config(noreplace) %attr(-,root,heat) %{_sysconfdir}/heat/heat-api-cfn.conf +%config(noreplace) %attr(-,root,heat) %{_sysconfdir}/heat/heat-api-cfn-paste.ini +%config(noreplace) %attr(-,root,heat) %{_sysconfdir}/heat/heat-api-cloudwatch.conf +%config(noreplace) %attr(-,root,heat) %{_sysconfdir}/heat/heat-api-cloudwatch-paste.ini +%config(noreplace) %attr(-,root,heat) %{_sysconfdir}/heat/heat-engine.conf +%config(noreplace) %attr(-,root,heat) %{_sysconfdir}/heat/heat-metadata.conf +%config(noreplace) %attr(-,root,heat) %{_sysconfdir}/heat/heat-metadata-paste.ini +%config(noreplace) %attr(-,root,heat) %{_sysconfdir}/heat/boto.cfg %pre -getent group openstack-heat >/dev/null || groupadd -r openstack-heat --gid 187 -getent passwd openstack-heat >/dev/null || \ -useradd -u 187 -r -g openstack-heat -d %{_localstatedir}/lib/heat -s /sbin/nologin \ - -c "OpenStack Heat Daemon" openstack-heat +# handle rename from old installs +getent passwd 187 | cut -f1 -d: | grep -qx "openstack-heat" +if [ $? -eq 0 ]; then + usermod -l heat openstack-heat + groupmod -n heat openstack-heat +fi + +getent group heat >/dev/null || groupadd -r heat --gid 187 +getent passwd heat >/dev/null || \ +useradd -u 187 -r -g heat -d %{_localstatedir}/lib/heat -s /sbin/nologin \ + -c "OpenStack Heat Daemon" heat exit 0 %post @@ -138,6 +145,12 @@ exit 0 %systemd_postun_with_restart heat-api-cloudwatch.service %changelog +* Wed May 29 2013 Jeff Peeler 7-2 +- changed require from python-paste to python-paste-deploy (rhbz#963207) +- changed UID/GID back again to heat instead of openstack-heat (rhbz#920348) + added group/user rename for old installs +- changed systemd scripts to match heat user + * Fri Oct 26 2012 Zane Bitter 7-1 - rebase to v7 - add heat-api daemon (OpenStack-native API)