diff -Nru horizon-15.1.1/debian/changelog horizon-15.1.1/debian/changelog --- horizon-15.1.1/debian/changelog 2019-12-13 18:34:45.000000000 +0530 +++ horizon-15.1.1/debian/changelog 2020-01-07 12:23:40.000000000 +0530 @@ -1,3 +1,12 @@ +horizon (3:15.1.1-0ubuntu1.2) disco; urgency=medium + + * Fix users/projects list when domain context is changed (LP: #1826114) + - d/p/fix-user-list-for-different-domain.patch + * GUI hangs on creation of project in User creation form (LP: #1826114) + - d/p/gui-hangs-on-project-creation.patch + + -- Hemanth Nakkina Tue, 07 Jan 2020 12:23:40 +0530 + horizon (3:15.1.1-0ubuntu1.1) disco; urgency=medium * No change rebuild to pick up xstatic orig tarball. diff -Nru horizon-15.1.1/debian/patches/fix-user-list-for-different-domain.patch horizon-15.1.1/debian/patches/fix-user-list-for-different-domain.patch --- horizon-15.1.1/debian/patches/fix-user-list-for-different-domain.patch 1970-01-01 05:30:00.000000000 +0530 +++ horizon-15.1.1/debian/patches/fix-user-list-for-different-domain.patch 2020-01-07 12:23:21.000000000 +0530 @@ -0,0 +1,50 @@ +From f6490abc288f667e9af299264e5eebf7eb931355 Mon Sep 17 00:00:00 2001 +From: Hemanth Nakkina +Date: Mon, 9 Dec 2019 14:59:59 +0530 +Subject: [PATCH] Fix users/projects list when domain context is changed + +In case of Keystone Multidomain setup, the project and users list +is empty when the domain context is changed. Horizon uses domain +scoped token for keystone api calls to get list of projects and users. +And domain scoped token cannot get information about projects and users +in other domains, the list is empty. + +This patch modifies the use of domain scoped token only when domain +context is not modified. + +The bug have 3 parts +1. Users are not listed on GUI in different domain +2. Projects are not listed on GUI in different domain +3. Gui hangs during creation of user/project using + option +This patch handles case 1 and 2. + +Change-Id: Ibafe3e2eb3ee1ee5c9eb5d2a276a0edfa3e7c607 +Partial-Bug: #1826114 +Closes-Bug: #1830782 +(cherry picked from commit 9aca7a94e28589484e312770cc1ee2b8243211bb) +--- + openstack_dashboard/api/keystone.py | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/openstack_dashboard/api/keystone.py b/openstack_dashboard/api/keystone.py +index c2fdc51b2..65706bfbf 100644 +--- a/openstack_dashboard/api/keystone.py ++++ b/openstack_dashboard/api/keystone.py +@@ -163,8 +163,12 @@ def keystoneclient(request, admin=False): + token_id = user.token.id + + if is_multi_domain_enabled(): +- # Cloud Admin, Domain Admin or Mixed Domain Admin +- if is_domain_admin(request): ++ is_domain_context_specified = bool( ++ request.session.get("domain_context")) ++ ++ # If user is Cloud Admin, Domain Admin or Mixed Domain Admin and there ++ # is no domain context specified, use domain scoped token ++ if is_domain_admin(request) and not is_domain_context_specified: + domain_token = request.session.get('domain_token') + if domain_token: + token_id = getattr(domain_token, 'auth_token', None) +-- +2.17.1 + diff -Nru horizon-15.1.1/debian/patches/gui-hangs-on-project-creation.patch horizon-15.1.1/debian/patches/gui-hangs-on-project-creation.patch --- horizon-15.1.1/debian/patches/gui-hangs-on-project-creation.patch 1970-01-01 05:30:00.000000000 +0530 +++ horizon-15.1.1/debian/patches/gui-hangs-on-project-creation.patch 2020-01-07 12:23:25.000000000 +0530 @@ -0,0 +1,41 @@ +From 4d19c56026e51ee496185734b18c896bee93023c Mon Sep 17 00:00:00 2001 +From: Hemanth Nakkina +Date: Wed, 11 Dec 2019 10:09:22 +0530 +Subject: [PATCH] GUI hangs on creation of project in User creation form + +On creation of project in user creation form, the response is sent +as html and the javascript try to parse the output as json and fails. + +The project creation response should be sent as text/plain so that +javascript can parse the string as json. + +The bug have 3 parts +1. Users are not listed on GUI in different domain +2. Projects are not listed on GUI in different domain +3. Gui hangs during creation of user/project using + option +Case 1 & 2 are fixed at https://review.opendev.org/#/c/697962/ +This patch fixes case 3. + +Change-Id: I4936a158ad99cf9d7514e79c06ed2315ce11218b +Closes-Bug: #1826114 +(cherry picked from commit 8fb86b2adbdf4fae63faabc8937728c43c1777d5) +--- + horizon/workflows/views.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/horizon/workflows/views.py b/horizon/workflows/views.py +index 0ce15a8f1..89ed1c044 100644 +--- a/horizon/workflows/views.py ++++ b/horizon/workflows/views.py +@@ -208,7 +208,7 @@ class WorkflowView(hz_views.ModalBackdropMixin, generic.TemplateView): + messages.error(request, msg) + if "HTTP_X_HORIZON_ADD_TO_FIELD" in self.request.META: + field_id = self.request.META["HTTP_X_HORIZON_ADD_TO_FIELD"] +- response = http.HttpResponse() ++ response = http.HttpResponse(content_type="text/plain") + if workflow.object: + data = [self.get_object_id(workflow.object), + self.get_object_display(workflow.object)] +-- +2.17.1 + diff -Nru horizon-15.1.1/debian/patches/series horizon-15.1.1/debian/patches/series --- horizon-15.1.1/debian/patches/series 2019-12-05 20:35:51.000000000 +0530 +++ horizon-15.1.1/debian/patches/series 2020-01-07 12:23:25.000000000 +0530 @@ -3,3 +3,5 @@ fix-dashboard-manage.patch ubuntu_settings.patch embedded-xstatic.patch +gui-hangs-on-project-creation.patch +fix-user-list-for-different-domain.patch