From f76a273227a1017c2d10b4045ef3460443a66663 Mon Sep 17 00:00:00 2001 From: Paul-Emile Element Date: Fri, 21 Sep 2018 09:50:12 -0400 Subject: [PATCH] move wsgi app/scriplets from stx-keystone to stx-upstream In an effort to reduce the number of stx specific code changes in the openstack core repos, this modification moves a small python scriplet into stx-upstream and adjusts the spec file to pick the file from the new location. Another scriptlet (admin.py) is no longer necessary and has been removed from the spec file. This commit does not include modification to the repo that contains the original sources, and does not require the original sources to be modified or removed. Removal of the original sources will be done separately and can only be done once this commit gets merged. Story: 2003112 Task: 23231 Change-Id: I3e86e8e952adb447e76cf970d71b5b37fccc210d Signed-off-by: Paul-Emile Element --- .../python-keystone/centos/files/public.py | 21 +++++++++++++++++++ .../centos/openstack-keystone.spec | 11 +++++----- 2 files changed, 26 insertions(+), 6 deletions(-) create mode 100644 openstack/python-keystone/centos/files/public.py diff --git a/openstack/python-keystone/centos/files/public.py b/openstack/python-keystone/centos/files/public.py new file mode 100644 index 00000000..d3a29f3b --- /dev/null +++ b/openstack/python-keystone/centos/files/public.py @@ -0,0 +1,21 @@ +# Copyright (c) 2013-2017 Wind River Systems, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + + +from keystone.server import wsgi as wsgi_server + +import sys +sys.argv = sys.argv[:1] + +application = wsgi_server.initialize_public_application() diff --git a/openstack/python-keystone/centos/openstack-keystone.spec b/openstack/python-keystone/centos/openstack-keystone.spec index 7dc5d5c3..4805e08c 100644 --- a/openstack/python-keystone/centos/openstack-keystone.spec +++ b/openstack/python-keystone/centos/openstack-keystone.spec @@ -21,7 +21,8 @@ Source4: openstack-keystone.defaultconf Source99: openstack-keystone.service Source100: keystone-all Source101: keystone-fernet-keys-rotate-active -Source102: password-rules.conf +Source102: password-rules.conf +Source103: public.py BuildArch: noarch BuildRequires: openstack-macros @@ -54,7 +55,7 @@ BuildRequires: python-testresources BuildRequires: python-babel #WRS: Need these for build_sphinx -BuildRequires: tsconfig +BuildRequires: tsconfig BuildRequires: python2-pycodestyle Requires: python-keystone = %{epoch}:%{version}-%{release} @@ -218,9 +219,8 @@ install -p -D -m 755 %{SOURCE101} %{buildroot}%{_bindir}/keystone-fernet-keys-ro # WRS: install password rules(readable only) install -p -D -m 440 %{SOURCE102} %{buildroot}%{_sysconfdir}/keystone/password-rules.conf -# WRS: install keystone public and admin gunicorn apps -install -p -D -m 755 etc/admin.py %{buildroot}/%{_datarootdir}/keystone/admin.py -install -p -D -m 755 etc/public.py %{buildroot}/%{_datarootdir}/keystone/public.py +# WRS: install keystone public gunicorn app +install -p -D -m 755 %{SOURCE103} %{buildroot}/%{_datarootdir}/keystone/public.py # WRS: install openstack-keystone service script install -p -D -m 644 %{SOURCE99} %{buildroot}%{_unitdir}/openstack-keystone.service @@ -292,7 +292,6 @@ exit 0 %files -n python-keystone %{_datarootdir}/keystone/public*.py* -%{_datarootdir}/keystone/admin*.py* %defattr(-,root,root,-) %doc README.rst %license LICENSE