[openstack-sahara] Bug fixes to upstream 2014.2.b3
Michael McCune
mimccune at fedoraproject.org
Wed Sep 24 19:22:29 UTC 2014
commit cba1c56011ec2eeffc2c0f731a5cf91740f9301e
Author: Michael McCune <mimccune at redhat.com>
Date: Wed Sep 24 13:17:15 2014 -0400
Bug fixes to upstream 2014.2.b3
Resolves: rhbz#1144529
Resolves: rhbz#1144531
Changelog:
- Bug fixes to upstream 2014.2.b3
- Resolves: rhbz#1144529
- Resolves: rhbz#1144531
- adding patch to fix keystonemiddleware==1.0.0 issues
0001-remove-runtime-dep-on-python-pbr.patch | 6 +-
...ference-actual-plugins-shipped-in-tarball.patch | 18 ++-
0003-Use-auth_uri-parameter-from-config.patch | 150 ++++++++++++++++++++
...ding-missing-CDH-resources-to-MANIFEST.in.patch | 27 ++++
...ck-sahara-api.init => openstack-sahara-all.init | 8 +-
...ara-api.service => openstack-sahara-all.service | 2 +-
openstack-sahara.spec | 38 +++--
7 files changed, 223 insertions(+), 26 deletions(-)
---
diff --git a/0001-remove-runtime-dep-on-python-pbr.patch b/0001-remove-runtime-dep-on-python-pbr.patch
index b41de8f..4161e9c 100644
--- a/0001-remove-runtime-dep-on-python-pbr.patch
+++ b/0001-remove-runtime-dep-on-python-pbr.patch
@@ -1,11 +1,11 @@
-From c7ca46c334d070078111e36b7962ec67585cbc66 Mon Sep 17 00:00:00 2001
+From 45bb666b284ca906e2b8a96ec4dd6168643d6330 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?P=C3=A1draig=20Brady?= <P at draigBrady.com>
Date: Thu, 17 Jul 2014 11:59:16 +0100
Subject: [PATCH] remove runtime dep on python-pbr
---
- sahara/version.py | 15 +++++++++++++--
- 1 files changed, 13 insertions(+), 2 deletions(-)
+ sahara/version.py | 15 +++++++++++++--
+ 1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/sahara/version.py b/sahara/version.py
index ba79883..fd70c87 100644
diff --git a/0002-reference-actual-plugins-shipped-in-tarball.patch b/0002-reference-actual-plugins-shipped-in-tarball.patch
index d945f66..4f506f8 100644
--- a/0002-reference-actual-plugins-shipped-in-tarball.patch
+++ b/0002-reference-actual-plugins-shipped-in-tarball.patch
@@ -1,15 +1,15 @@
-From 05df127529293acd75cc73373625fff6cfb5a231 Mon Sep 17 00:00:00 2001
+From eef37a6b34b485ad5fd823a4bb8355e44a08f6db Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?P=C3=A1draig=20Brady?= <P at draigBrady.com>
Date: Thu, 17 Jul 2014 12:01:00 +0100
Subject: [PATCH] reference actual plugins shipped in tarball
Report and analysis from Dalmais Maxence <maxence.dalmais at worldline.com>
---
- MANIFEST.in | 2 ++
- 1 files changed, 2 insertions(+), 0 deletions(-)
+ MANIFEST.in | 5 +++++
+ 1 file changed, 5 insertions(+)
diff --git a/MANIFEST.in b/MANIFEST.in
-index 20fc1c8..6d5538b 100644
+index 96f5498..07ba666 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -4,8 +4,10 @@ include ChangeLog
@@ -23,3 +23,13 @@ index 20fc1c8..6d5538b 100644
recursive-include sahara/locale *
+@@ -16,6 +18,9 @@ include sahara/plugins/vanilla/v1_2_1/resources/*.sh
+ include sahara/plugins/vanilla/v1_2_1/resources/*.sql
+ include sahara/plugins/vanilla/v1_2_1/resources/*.xml
+ include sahara/plugins/vanilla/v2_3_0/resources/*.xml
++include sahara/plugins/vanilla/v2_3_0/resources/*.sh
++include sahara/plugins/vanilla/v2_3_0/resources/*.sql
++include sahara/plugins/vanilla/v2_3_0/resources/*.template
+ include sahara/plugins/vanilla/v2_4_1/resources/*.xml
+ include sahara/plugins/hdp/versions/version_1_3_2/resources/*.template
+ include sahara/plugins/hdp/versions/version_1_3_2/resources/*.json
diff --git a/0003-Use-auth_uri-parameter-from-config.patch b/0003-Use-auth_uri-parameter-from-config.patch
new file mode 100644
index 0000000..491584f
--- /dev/null
+++ b/0003-Use-auth_uri-parameter-from-config.patch
@@ -0,0 +1,150 @@
+From 939ca068c3e7b449831f34f0694a9828433ec191 Mon Sep 17 00:00:00 2001
+From: Sergey Reshetnyak <sreshetniak at mirantis.com>
+Date: Thu, 18 Sep 2014 15:49:34 +0400
+Subject: [PATCH] Use 'auth_uri' parameter from config
+
+Change-Id: I0276d30d8e142dca120915a8c91a500159a353d3
+Closes-bug: #1371012
+---
+ sahara/api/acl.py | 11 +----------
+ sahara/context.py | 29 +++++++++++++++++++++++++++--
+ sahara/tests/unit/test_context.py | 30 ++++++++++++++++++++++++++++++
+ 3 files changed, 58 insertions(+), 12 deletions(-)
+
+diff --git a/sahara/api/acl.py b/sahara/api/acl.py
+index e404827..8891f5a 100644
+--- a/sahara/api/acl.py
++++ b/sahara/api/acl.py
+@@ -23,18 +23,9 @@ CONF = cfg.CONF
+
+ AUTH_OPT_GROUP_NAME = 'keystone_authtoken'
+
+-# Keystone auth uri that could be used in other places in Sahara
+-AUTH_URI = None
+-
+
+ def wrap(app, conf):
+ """Wrap wsgi application with ACL check."""
+
+ auth_cfg = dict(conf.get(AUTH_OPT_GROUP_NAME))
+- auth_protocol = auth_token.AuthProtocol(app, conf=auth_cfg)
+-
+- # store auth uri in global var to be able to use it in runtime
+- global AUTH_URI
+- AUTH_URI = auth_protocol._identity_server.auth_uri
+-
+- return auth_protocol
++ return auth_token.AuthProtocol(app, conf=auth_cfg)
+diff --git a/sahara/context.py b/sahara/context.py
+index 9db3233..3f4bf3b 100644
+--- a/sahara/context.py
++++ b/sahara/context.py
+@@ -20,7 +20,6 @@ from eventlet import greenpool
+ from eventlet import semaphore
+ from oslo.config import cfg
+
+-from sahara.api import acl
+ from sahara import exceptions as ex
+ from sahara.i18n import _
+ from sahara.i18n import _LE
+@@ -49,6 +48,7 @@ class Context(object):
+ if kwargs:
+ LOG.warn(_LW('Arguments dropped when creating context: %s'),
+ kwargs)
++
+ self.user_id = user_id
+ self.tenant_id = tenant_id
+ self.token = token
+@@ -59,7 +59,10 @@ class Context(object):
+ self.remote_semaphore = remote_semaphore or semaphore.Semaphore(
+ CONF.cluster_remote_threshold)
+ self.roles = roles
+- self.auth_uri = auth_uri or acl.AUTH_URI
++ if auth_uri:
++ self.auth_uri = auth_uri
++ else:
++ self.auth_uri = _get_auth_uri()
+
+ def clone(self):
+ return Context(
+@@ -122,6 +125,28 @@ def set_ctx(new_ctx):
+ setattr(_CTX_STORE, _CTX_KEY, new_ctx)
+
+
++def _get_auth_uri():
++ if CONF.keystone_authtoken.auth_uri is not None:
++ auth_uri = CONF.keystone_authtoken.auth_uri
++ else:
++ if CONF.keystone_authtoken.identity_uri is not None:
++ identity_uri = CONF.keystone_authtoken.identity_uri
++ else:
++ host = CONF.keystone_authtoken.auth_host
++ port = CONF.keystone_authtoken.auth_port
++ protocol = CONF.keystone_authtoken.auth_protocol
++ identity_uri = '%s://%s:%s' % (protocol, host, port)
++
++ if CONF.use_identity_api_v3 is False:
++ auth_version = 'v2.0'
++ else:
++ auth_version = 'v3'
++
++ auth_uri = '%s/%s' % (identity_uri, auth_version)
++
++ return auth_uri
++
++
+ def _wrapper(ctx, thread_description, thread_group, func, *args, **kwargs):
+ try:
+ set_ctx(ctx)
+diff --git a/sahara/tests/unit/test_context.py b/sahara/tests/unit/test_context.py
+index e6cd94b..327c476 100644
+--- a/sahara/tests/unit/test_context.py
++++ b/sahara/tests/unit/test_context.py
+@@ -13,6 +13,7 @@
+ # See the License for the specific language governing permissions and
+ # limitations under the License.
+
++import functools
+ import random
+
+ import fixtures
+@@ -22,6 +23,7 @@ import testtools
+
+ from sahara import context
+ from sahara import exceptions as ex
++from sahara.tests.unit import base as test_base
+
+
+ rnd = random.Random()
+@@ -135,3 +137,31 @@ class ContextTest(testtools.TestCase):
+
+ class TestException(Exception):
+ pass
++
++
++class GetAuthURITest(test_base.SaharaTestCase):
++ def setUp(self):
++ super(GetAuthURITest, self).setUp()
++
++ self.override_auth_config = functools.partial(
++ self.override_config, group='keystone_authtoken')
++
++ def test_get_auth_url_from_auth_uri_param(self):
++ self.override_auth_config('auth_uri', 'http://pony:5000/v2.0')
++ self.assertEqual('http://pony:5000/v2.0', context._get_auth_uri())
++
++ def test_get_auth_uri_from_identity_uri(self):
++ self.override_auth_config('identity_uri', 'http://spam:35357')
++ self.assertEqual('http://spam:35357/v3', context._get_auth_uri())
++
++ self.override_config('use_identity_api_v3', False)
++ self.assertEqual('http://spam:35357/v2.0', context._get_auth_uri())
++
++ def test_get_auth_uri_from_auth_params(self):
++ self.override_auth_config('auth_host', 'eggs')
++ self.override_auth_config('auth_port', 12345)
++ self.override_auth_config('auth_protocol', 'http')
++ self.assertEqual('http://eggs:12345/v3', context._get_auth_uri())
++
++ self.override_config('use_identity_api_v3', False)
++ self.assertEqual('http://eggs:12345/v2.0', context._get_auth_uri())
diff --git a/0004-Adding-missing-CDH-resources-to-MANIFEST.in.patch b/0004-Adding-missing-CDH-resources-to-MANIFEST.in.patch
new file mode 100644
index 0000000..6c3e373
--- /dev/null
+++ b/0004-Adding-missing-CDH-resources-to-MANIFEST.in.patch
@@ -0,0 +1,27 @@
+From 9d14e43be744b27079f09c2b0ddd19bfe9aba7e0 Mon Sep 17 00:00:00 2001
+From: Michael McCune <mimccune at redhat.com>
+Date: Mon, 22 Sep 2014 21:39:04 -0400
+Subject: [PATCH] Adding missing CDH resources to MANIFEST.in
+
+Closes-Bug: #1372711
+Change-Id: I5f223cf92810ce00de1f79646c1f3a0b5c9cfaab
+
+Resolves: rhbz#1144529
+---
+ MANIFEST.in | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/MANIFEST.in b/MANIFEST.in
+index 07ba666..bd7117f 100644
+--- a/MANIFEST.in
++++ b/MANIFEST.in
+@@ -11,6 +11,9 @@ include sahara/db/migration/alembic_migrations/versions/*.py
+
+ recursive-include sahara/locale *
+
++include sahara/plugins/cdh/resources/cdh_config.py
++include sahara/plugins/cdh/resources/*.sh
++include sahara/plugins/cdh/resources/*.json
+ include sahara/plugins/vanilla/hadoop2/resources/*.sh
+ include sahara/plugins/vanilla/hadoop2/resources/*.sql
+ include sahara/plugins/vanilla/hadoop2/resources/*.template
diff --git a/openstack-sahara-api.init b/openstack-sahara-all.init
similarity index 92%
rename from openstack-sahara-api.init
rename to openstack-sahara-all.init
index 4b83ade..667fa44 100644
--- a/openstack-sahara-api.init
+++ b/openstack-sahara-all.init
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# openstack-sahara-api OpenStack Sahara API Server
+# openstack-sahara-all OpenStack Sahara API Server
#
# chkconfig: - 98 02
# description: Sahara provides the ability to elastically manage Apache \
@@ -18,11 +18,11 @@
. /etc/rc.d/init.d/functions
-prog=openstack-sahara-api
-exec="/usr/bin/sahara-api"
+prog=openstack-sahara-all
+exec="/usr/bin/sahara-all"
config="/etc/sahara/sahara.conf"
logfile="/var/log/sahara/api.log"
-pidfile="/var/run/sahara/sahara-api.pid"
+pidfile="/var/run/sahara/sahara-all.pid"
[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
diff --git a/openstack-sahara-api.service b/openstack-sahara-all.service
similarity index 69%
rename from openstack-sahara-api.service
rename to openstack-sahara-all.service
index 8d6beb4..66da73d 100644
--- a/openstack-sahara-api.service
+++ b/openstack-sahara-all.service
@@ -5,7 +5,7 @@ After=syslog.target network.target
[Service]
Type=simple
User=sahara
-ExecStart=/usr/bin/sahara-api --config-file /etc/sahara/sahara.conf
+ExecStart=/usr/bin/sahara-all --config-file /etc/sahara/sahara.conf
[Install]
WantedBy=multi-user.target
diff --git a/openstack-sahara.spec b/openstack-sahara.spec
index 9c73722..1d319c0 100644
--- a/openstack-sahara.spec
+++ b/openstack-sahara.spec
@@ -27,15 +27,15 @@
Name: openstack-sahara
Version: 2014.2
-Release: 0.3.b%{milestone}%{?dist}
+Release: 0.4.b%{milestone}%{?dist}
Provides: openstack-savanna = %{version}-%{release}
Summary: Apache Hadoop cluster management on OpenStack
License: ASL 2.0
URL: https://launchpad.net/sahara
#Source0: http://launchpad.net/sahara/%{release_name}/%{version}/+download/sahara-%{version}.tar.gz
Source0: http://launchpad.net/sahara/%{release_name}/%{release_name}-%{milestone}/+download/sahara-%{version}.b%{milestone}.tar.gz
-Source1: openstack-sahara-api.service
-Source2: openstack-sahara-api.init
+Source1: openstack-sahara-all.service
+Source2: openstack-sahara-all.init
BuildArch: noarch
#
@@ -43,6 +43,8 @@ BuildArch: noarch
#
Patch0001: 0001-remove-runtime-dep-on-python-pbr.patch
Patch0002: 0002-reference-actual-plugins-shipped-in-tarball.patch
+Patch0003: 0003-Use-auth_uri-parameter-from-config.patch
+Patch0004: 0004-Adding-missing-CDH-resources-to-MANIFEST.in.patch
BuildRequires: python2-devel
BuildRequires: python-setuptools
@@ -109,6 +111,8 @@ install, use, and manage the Sahara infrastructure.
%patch0001 -p1
%patch0002 -p1
+%patch0003 -p1
+%patch0004 -p1
sed -i s/REDHAT_SAHARA_VERSION/%{version}/ sahara/version.py
sed -i s/REDHAT_SAHARA_RELEASE/%{release}/ sahara/version.py
@@ -147,10 +151,10 @@ rm -rf html/.{doctrees,buildinfo}
%{__python2} setup.py install --skip-build --root %{buildroot}
%if %{want_systemd}
-install -p -D -m 644 %{SOURCE1} %{buildroot}%{_unitdir}/openstack-sahara-api.service
+install -p -D -m 644 %{SOURCE1} %{buildroot}%{_unitdir}/openstack-sahara-all.service
%else
install -d -m 755 %{buildroot}%{_localstatedir}/run/sahara
-install -p -D -m 755 %{SOURCE2} %{buildroot}%{_initrddir}/openstack-sahara-api
+install -p -D -m 755 %{SOURCE2} %{buildroot}%{_initrddir}/openstack-sahara-all
%endif
HOME=%{_sharedstatedir}/sahara
@@ -196,30 +200,30 @@ exit 0
%post
# TODO: if db file then sahara-db-manage update head
%if %{want_systemd}
-%systemd_post openstack-sahara-api.service
+%systemd_post openstack-sahara-all.service
%else
-/sbin/chkconfig --add openstack-sahara-api
+/sbin/chkconfig --add openstack-sahara-all
%endif
%preun
%if %{want_systemd}
-%systemd_preun openstack-sahara-api.service
+%systemd_preun openstack-sahara-all.service
%else
if [ $1 -eq 0 ] ; then
- /sbin/service openstack-sahara-api stop >/dev/null 2>&1
- /sbin/chkconfig --del openstack-sahara-api
+ /sbin/service openstack-sahara-all stop >/dev/null 2>&1
+ /sbin/chkconfig --del openstack-sahara-all
fi
%endif
%postun
%if %{want_systemd}
-%systemd_postun_with_restart openstack-sahara-api.service
+%systemd_postun_with_restart openstack-sahara-all.service
%else
if [ $1 -ge 1 ] ; then
# Package upgrade, not uninstall
- /sbin/service openstack-sahara-api condrestart > /dev/null 2>&1 || :
+ /sbin/service openstack-sahara-all condrestart > /dev/null 2>&1 || :
fi
%endif
@@ -229,9 +233,9 @@ fi
%if %{have_rhel6}
%dir %attr(0755, %{sahara_user}, root) %{_localstatedir}/run/sahara
-%{_initrddir}/openstack-sahara-api
+%{_initrddir}/openstack-sahara-all
%else
-%{_unitdir}/openstack-sahara-api.service
+%{_unitdir}/openstack-sahara-all.service
%endif
%dir %{_sysconfdir}/sahara
@@ -256,6 +260,12 @@ fi
%changelog
+* Wed Sep 24 2014 Michael McCune <mimccune at redhat.com> 2014.2-0.4.b3
+- Bug fixes to upstream 2014.2.b3
+- Resolves: rhbz#1144529
+- Resolves: rhbz#1144531
+- adding patch to fix keystonemiddleware==1.0.0 issues
+
* Tue Sep 16 2014 Michael McCune <mimccune at redhat.com> - 2014.2-0.3.b3
- spec cleanup
More information about the scm-commits
mailing list