Skip to content

Commit 02f3e0c

Browse files
image: install cauth with package
Change-Id: Ibaa3af2b7ba33572803de0b695f3803df10281a6 Depends-On: Ieef94601aeef7da61ccac65fa4ed5492e9bcddb7 Depends-On: I8357bc82efbdb9c449ba1a15a63552c457693ee5
1 parent 9e1002c commit 02f3e0c

File tree

5 files changed

+6
-48
lines changed

5 files changed

+6
-48
lines changed

config/ansible/roles/sf-base/tasks/setup.yml

-1
Original file line numberDiff line numberDiff line change
@@ -147,4 +147,3 @@
147147
when: new_crt|changed
148148
with_items:
149149
- /usr/lib/python2.7/site-packages/requests/
150-
- /var/www/cauth/lib/python2.7/site-packages/requests/

config/ansible/roles/sf-cauth/files/cauth.site

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
WSGIScriptAlias /auth /var/www/cauth/app.wsgi
2-
WSGIDaemonProcess cauth python-path=/var/www/cauth/lib/python2.7/site-packages
2+
WSGIDaemonProcess cauth
33
<Location /auth>
44
WSGIPassAuthorization On
55
WSGIProcessGroup cauth
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,7 @@
11
---
22
- name: "Install requirements"
33
yum:
4-
name: "mod_auth_pubtkt"
4+
name: "mod_auth_pubtkt, python2-cauth"
55
state: present
66
disablerepo: "{{ yum_disable_repo|default(omit) }}"
77
enablerepo: "{{ yum_enable_repo|default(omit) }}"
8-
9-
- name: "Install cauth venv"
10-
command: chdir=/usr/src/cauth {{ item }}
11-
with_items:
12-
- virtualenv /var/www/cauth
13-
- /var/www/cauth/bin/pip install --upgrade 'pbr' 'pip'
14-
- sed -i 's/^.*pysflib.*//' requirements.txt
15-
- sed -i 's/^paramiko.*/paramiko<2/' requirements.txt
16-
- /var/www/cauth/bin/pip install -rrequirements.txt
17-
- /var/www/cauth/bin/python setup.py install
18-
19-
- name: "Install pysflib"
20-
command: chdir=/usr/src/pysflib {{ item }}
21-
with_items:
22-
- /var/www/cauth/bin/pip install -rrequirements.txt
23-
- /var/www/cauth/bin/python setup.py install

functestslib.sh

+3-5
Original file line numberDiff line numberDiff line change
@@ -209,11 +209,9 @@ function build_image {
209209
sudo rsync -a --delete --no-owner config/config-repo/ ${IMAGE_PATH}/usr/local/share/sf-config-repo/
210210
sudo rsync -a --delete --no-owner serverspec/ ${IMAGE_PATH}/etc/serverspec/
211211
sudo rsync -a config/scripts/ ${IMAGE_PATH}/usr/local/bin/
212-
sudo rsync -a --delete ${MANAGESF_CLONED_PATH}/managesf/ ${IMAGE_PATH}/var/www/managesf/lib/python2.7/site-packages/managesf/
213-
sudo rsync -a --delete ${CAUTH_CLONED_PATH}/cauth/ ${IMAGE_PATH}/var/www/cauth/lib/python2.7/site-packages/cauth/
214-
for sflibuser in /var/www/cauth /var/www/managesf /srv/sfmanager; do
215-
sudo rsync -a --delete ${PYSFLIB_CLONED_PATH}/pysflib/ ${IMAGE_PATH}/${sflibuser}/lib/python2.7/site-packages/pysflib/
216-
done
212+
sudo rsync -a --delete ${MANAGESF_CLONED_PATH}/managesf/ ${IMAGE_PATH}/usr/lib/python2.7/site-packages/managesf/
213+
sudo rsync -a --delete ${CAUTH_CLONED_PATH}/cauth/ ${IMAGE_PATH}/usr/lib/python2.7/site-packages/cauth/
214+
sudo rsync -a --delete ${PYSFLIB_CLONED_PATH}/pysflib/ ${IMAGE_PATH}/usr/lib/python2.7/site-packages/pysflib/
217215
sudo cp image/edeploy/edeploy ${IMAGE_PATH}/usr/sbin/edeploy
218216
set +e
219217
fi

image/softwarefactory.install

+1-24
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,7 @@ remove_obsolete() {
341341
rm -Rf ${dir}/srv/sfmanager
342342
rm -Rf ${dir}/usr/local/murmur
343343
rm -Rf ${dir}/var/www/managesf
344+
rm -Rf ${dir}/var/www/cauth
344345

345346
# Gemfile is a sign /var/www/static was setup manually. It's now replaced by sf-web-assets package
346347
if [ -f ${dir}/var/www/static/font-awesome/Gemfile ]; then
@@ -354,10 +355,6 @@ fix_ansible_issue5504() {
354355

355356
function install_sf {
356357
set -e
357-
test -n "${CAUTH_CLONED_PATH}"
358-
test -n "${MANAGESF_CLONED_PATH}"
359-
test -n "${PYSFLIB_CLONED_PATH}"
360-
test -n "${SFMANAGER_CLONED_PATH}"
361358

362359
mkdir -p ${dir}/usr/src
363360

@@ -370,14 +367,6 @@ function install_sf {
370367
retry do_chroot ${dir} pip install 'pip<8' ${STAGING_PIP}
371368
fi
372369

373-
# Make sure subproject are available
374-
if [ ! -d "${CAUTH_CLONED_PATH}" ] || [ ! -d "${MANAGESF_CLONED_PATH}" ] || \
375-
[ ! -d "${PYSFLIB_CLONED_PATH}" ] || [ ! -d "${SFMANAGER_CLONED_PATH}" ]; then
376-
echo "Can't find subprojects in $(dirname ${CAUTH_CLONED_PATH})"
377-
echo "Run ./image/fetch_subprojects.sh first"
378-
exit -1
379-
fi
380-
381370
# Make sure final image use latest ids.tables
382371
cp ./C7.0-ids.tables ${dir}/etc/ids.tables
383372

@@ -406,14 +395,6 @@ function install_sf {
406395
# be used as slave base image
407396
cp -Rv ./../tools/slaves/* ${dir}/usr/local/bin/
408397

409-
# Install cauth
410-
rsync -a --delete ${CAUTH_CLONED_PATH}/ ${dir}/usr/src/cauth/
411-
do_chroot ${dir} bash -c "cd /usr/src/cauth; /var/www/cauth/bin/python setup.py install"
412-
413-
# Install pysflib
414-
rsync -a --delete ${PYSFLIB_CLONED_PATH}/ ${dir}/usr/src/pysflib/
415-
do_chroot ${dir} bash -c "cd /usr/src/pysflib; /var/www/cauth/bin/python setup.py install"
416-
417398
do_chroot ${dir} find /root /var/www /srv/ -name "*.pyc" -exec rm {} \;
418399

419400
# Documentation
@@ -468,10 +449,6 @@ build_all() {
468449
checkpoint "edeploy, serverspect installed"
469450
remove_obsolete
470451
copy_sf_ansible_roles
471-
# Copy prepared source to support depends-on
472-
rsync -a --delete --exclude 'build' ${MANAGESF_CLONED_PATH}/ ${dir}/usr/src/managesf/
473-
rsync -a --delete --exclude 'build' ${CAUTH_CLONED_PATH}/ ${dir}/usr/src/cauth/
474-
rsync -a --delete --exclude 'build' ${PYSFLIB_CLONED_PATH}/ ${dir}/usr/src/pysflib/
475452
ansible_install sf-base
476453
ansible_install sf-gateway
477454
ansible_install sf-jenkins "$JENKINS_EXTRA_VARS"

0 commit comments

Comments
 (0)