Merge lp:~verterok/canonical-identity-provider/xenial-charm into lp:~ubuntuone-pqm-team/canonical-identity-provider/charm

Proposed by Guillermo Gonzalez on 2019-04-30
Status: Merged
Approved by: Guillermo Gonzalez on 2019-05-22
Approved revision: 94
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: lp:~verterok/canonical-identity-provider/xenial-charm
Merge into: lp:~ubuntuone-pqm-team/canonical-identity-provider/charm
Diff against target: 201 lines (+43/-18)
9 files modified
config.yaml (+0/-4)
hooks/hooks.py (+3/-0)
hooks/install (+21/-0)
playbook.yaml (+8/-7)
roles/directories-and-permissions/handlers/main.yaml (+3/-1)
roles/directories-and-permissions/tasks/main.yaml (+3/-1)
roles/django/tasks/main.yaml (+3/-3)
templates/settings.py.j2 (+1/-1)
unit_tests/test_templates.py (+1/-1)
To merge this branch: bzr merge lp:~verterok/canonical-identity-provider/xenial-charm
Reviewer Review Type Date Requested Status
Daniel Manrique 2019-04-30 Approve on 2019-04-30
Review via email: mp+366733@code.launchpad.net

Commit message

make it work in xenial

Description of the change

Please do not land this as it will break CI, we need to coordinate landing of several branches and jenkins config updates

To post a comment you must log in.
Daniel Manrique (roadmr) wrote :

LGTM

review: Approve
94. By Guillermo Gonzalez on 2019-05-22

fix template tests

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'config.yaml'
--- config.yaml 2018-08-31 18:29:22 +0000
+++ config.yaml 2019-05-22 17:28:46 +0000
@@ -209,10 +209,6 @@
209 type: string209 type: string
210 default: ""210 default: ""
211 description: Key for SAML cert for google, in base64211 description: Key for SAML cert for google, in base64
212 user:
213 default: ubunet
214 type: string
215 description: user to run under
216 raven_dsn:212 raven_dsn:
217 type: string213 type: string
218 default: ""214 default: ""
219215
=== modified file 'hooks/hooks.py'
--- hooks/hooks.py 2015-12-01 17:52:16 +0000
+++ hooks/hooks.py 2019-05-22 17:28:46 +0000
@@ -70,4 +70,7 @@
7070
7171
72if __name__ == "__main__":72if __name__ == "__main__":
73 # workaround install.real script name
74 if 'install.real' in sys.argv[0]:
75 sys.argv[0] = sys.argv[0].replace('install.real', 'install')
73 hooks.execute(sys.argv)76 hooks.execute(sys.argv)
7477
=== added file 'hooks/install'
--- hooks/install 1970-01-01 00:00:00 +0000
+++ hooks/install 2019-05-22 17:28:46 +0000
@@ -0,0 +1,21 @@
1#!/bin/bash
2# Wrapper to deal with newer Ubuntu versions that don't have py2 installed
3# by default.
4
5declare -a DEPS=('apt' 'netaddr' 'netifaces' 'pip' 'yaml')
6
7check_and_install() {
8 pkg="${1}-${2}"
9 if ! dpkg -s ${pkg} 2>&1 > /dev/null; then
10 apt-get -y install ${pkg}
11 fi
12}
13
14PYTHON="python"
15
16for dep in ${DEPS[@]}; do
17 check_and_install ${PYTHON} ${dep}
18done
19
20exec ./hooks/install.real
21
022
=== renamed symlink 'hooks/install' => 'hooks/install.real'
=== modified file 'playbook.yaml'
--- playbook.yaml 2018-07-11 15:47:41 +0000
+++ playbook.yaml 2019-05-22 17:28:46 +0000
@@ -2,6 +2,7 @@
2- hosts: localhost2- hosts: localhost
33
4 vars:4 vars:
5 user: "ubunet"
5 hostdir: /srv/{{ hostname }}6 hostdir: /srv/{{ hostname }}
6 basedir: /srv/{{ hostname }}/{{ deployment }}7 basedir: /srv/{{ hostname }}/{{ deployment }}
7 code_dir: "{{ basedir }}/code"8 code_dir: "{{ basedir }}/code"
@@ -10,13 +11,13 @@
10 venv: "{{ current_dir }}/env"11 venv: "{{ current_dir }}/env"
11 python: "{{ venv }}/bin/python"12 python: "{{ venv }}/bin/python"
12 wheel_dir: "{{ current_dir }}/branches/wheels"13 wheel_dir: "{{ current_dir }}/branches/wheels"
13 log_dir: "{{ basedir }}/logs"14 logs_dir: "{{ basedir }}/logs"
14 sso_log: "{{ log_dir }}/sso.log"15 sso_log: "{{ logs_dir }}/sso.log"
15 oops_dir: "{{ basedir }}/logs/www-oops"16 oops_dir: "{{ basedir }}/logs/www-oops"
16 conf_dir: "{{ basedir }}/etc"17 conf_dir: "{{ basedir }}/etc"
17 run_dir: "{{ basedir }}/run"18 run_dir: "{{ basedir }}/run"
18 bin_dir: "{{ basedir }}/bin"19 bin_dir: "{{ basedir }}/bin"
19 migrate_log_dir: "{{ log_dir }}/schema-updates"20 migrate_log_dir: "{{ logs_dir }}/schema-updates"
20 db_readonly_path: "{{ run_dir }}"21 db_readonly_path: "{{ run_dir }}"
21 port: 808022 port: 8080
22 conn_check_script: "{{ current_dir }}/scripts/settings-to-conncheck.py"23 conn_check_script: "{{ current_dir }}/scripts/settings-to-conncheck.py"
@@ -46,14 +47,14 @@
46 when: relations['nrpe-external-master'] and 'nagios_host_context' in relations['nrpe-external-master'][0]47 when: relations['nrpe-external-master'] and 'nagios_host_context' in relations['nrpe-external-master'][0]
4748
48 - role: directories-and-permissions49 - role: directories-and-permissions
49 user: "{{ user }}"50 user: "ubunet"
50 readonly_dirs:51 readonly_dirs:
51 - "{{ code_dir }}"52 - "{{ code_dir }}"
52 - "{{ archive_dir }}"53 - "{{ archive_dir }}"
53 - "{{ conf_dir }}"54 - "{{ conf_dir }}"
54 - "{{ bin_dir }}"55 - "{{ bin_dir }}"
55 writable_dirs:56 writable_dirs:
56 - "{{ log_dir }}"57 - "{{ logs_dir }}"
57 - "{{ run_dir }}"58 - "{{ run_dir }}"
58 - "{{ oops_dir }}"59 - "{{ oops_dir }}"
59 - "{{ migrate_log_dir }}"60 - "{{ migrate_log_dir }}"
@@ -72,7 +73,7 @@
72 current_symlink: "{{ build_label }}"73 current_symlink: "{{ build_label }}"
73 service_name: "{{ hostname }}"74 service_name: "{{ hostname }}"
74 listen_port: "{{ port }}"75 listen_port: "{{ port }}"
75 log_dir: "{{ log_dir }}"76 log_dir: "{{ logs_dir }}"
76 wsgi_user: "{{ user }}"77 wsgi_user: "{{ user }}"
77 wsgi_group: "{{ user }}"78 wsgi_group: "{{ user }}"
78 wsgi_application: django_project.wsgi79 wsgi_application: django_project.wsgi
@@ -162,7 +163,7 @@
162 tags:163 tags:
163 - config-changed164 - config-changed
164 file:165 file:
165 path: "{{ log_dir }}/sso.log"166 path: "{{ logs_dir }}/sso.log"
166 src: /var/log/upstart/gunicorn.log167 src: /var/log/upstart/gunicorn.log
167 state: link168 state: link
168 # temporary when until migrated to talisker169 # temporary when until migrated to talisker
169170
=== modified file 'roles/directories-and-permissions/handlers/main.yaml'
--- roles/directories-and-permissions/handlers/main.yaml 2015-10-01 13:52:11 +0000
+++ roles/directories-and-permissions/handlers/main.yaml 2019-05-22 17:28:46 +0000
@@ -1,7 +1,9 @@
1# ansible file module's recursion seems broken1# ansible file module's recursion seems broken
2- name: Ensure group ownership2- name: Ensure group ownership
3 shell: chown -R :{{ user }} {{ item }}3 shell: chown -R :{{ user }} {{ item }}
4 with_items: readonly_dirs + writable_dirs4 with_flattened:
5 - readonly_dirs
6 - writable_dirs
57
6- name: Ensure readonly group permissions8- name: Ensure readonly group permissions
7 shell: chmod -R g-w {{ item }}9 shell: chmod -R g-w {{ item }}
810
=== modified file 'roles/directories-and-permissions/tasks/main.yaml'
--- roles/directories-and-permissions/tasks/main.yaml 2015-10-01 13:52:11 +0000
+++ roles/directories-and-permissions/tasks/main.yaml 2019-05-22 17:28:46 +0000
@@ -16,7 +16,9 @@
16 - upgrade-charm16 - upgrade-charm
17 - config-changed17 - config-changed
18 command: mkdir -p {{ item }}18 command: mkdir -p {{ item }}
19 with_items: readonly_dirs + writable_dirs 19 with_flattened:
20 - readonly_dirs
21 - writable_dirs
2022
21- name: Force permissions23- name: Force permissions
22 tags:24 tags:
2325
=== modified file 'roles/django/tasks/main.yaml'
--- roles/django/tasks/main.yaml 2018-02-26 15:51:30 +0000
+++ roles/django/tasks/main.yaml 2019-05-22 17:28:46 +0000
@@ -14,20 +14,20 @@
14 when: has_syncdb|success14 when: has_syncdb|success
15 tags: migrate15 tags: migrate
16 command: "{{ python }} {{ manage }} syncdb --noinput"16 command: "{{ python }} {{ manage }} syncdb --noinput"
17 environment: migrate_env17 environment: "{{ migrate_env }}"
18 args:18 args:
19 chdir: "{{ src_dir }}"19 chdir: "{{ src_dir }}"
2020
21- name: run migrations21- name: run migrations
22 tags: migrate22 tags: migrate
23 command: "{{ python }} {{ manage }} migrate --noinput {% if build_label == 'r1604' %}--fake-initial{% endif %}"23 command: "{{ python }} {{ manage }} migrate --noinput {% if build_label == 'r1604' %}--fake-initial{% endif %}"
24 environment: migrate_env24 environment: "{{ migrate_env }}"
25 args:25 args:
26 chdir: "{{ src_dir }}"26 chdir: "{{ src_dir }}"
2727
28- name: grant user28- name: grant user
29 tags: migrate29 tags: migrate
30 command: "{{ python }} {{ manage }} grantuser {{ grant_user }}"30 command: "{{ python }} {{ manage }} grantuser {{ grant_user }}"
31 environment: migrate_env31 environment: "{{ migrate_env }}"
32 args:32 args:
33 chdir: "{{ src_dir }}"33 chdir: "{{ src_dir }}"
3434
=== modified file 'templates/settings.py.j2'
--- templates/settings.py.j2 2018-08-31 18:29:22 +0000
+++ templates/settings.py.j2 2019-05-22 17:28:46 +0000
@@ -6,7 +6,7 @@
6import os6import os
77
8os.environ['SSO_HOST_DIR'] = "{{ hostdir }}"8os.environ['SSO_HOST_DIR'] = "{{ hostdir }}"
9os.environ.setdefault('SSO_LOGS_DIR', "{{ log_dir }}")9os.environ.setdefault('SSO_LOGS_DIR', "{{ logs_dir }}")
10os.environ.setdefault('SSO_ROOT_URL', "https://{{ hostname }}")10os.environ.setdefault('SSO_ROOT_URL', "https://{{ hostname }}")
1111
12from django_project.settings_base import *12from django_project.settings_base import *
1313
=== modified file 'unit_tests/test_templates.py'
--- unit_tests/test_templates.py 2017-10-10 16:11:43 +0000
+++ unit_tests/test_templates.py 2019-05-22 17:28:46 +0000
@@ -109,7 +109,7 @@
109 "port": 8080,109 "port": 8080,
110 "hostdir": "/hostdir",110 "hostdir": "/hostdir",
111 "basedir": "/basedir",111 "basedir": "/basedir",
112 "log_dir": "/logdir",112 "logs_dir": "/logdir",
113 "db_readonly_path": "/tmp",113 "db_readonly_path": "/tmp",
114 "google_saml_key_path": "/saml/key",114 "google_saml_key_path": "/saml/key",
115 "google_saml_cert_path": "/saml/cert",115 "google_saml_cert_path": "/saml/cert",

Subscribers

People subscribed via source and target branches