Merge lp:~corey.bryant/horizon/2014.1.4 into lp:~ubuntu-server-dev/horizon/icehouse
- 2014.1.4
- Merge into icehouse
Status: | Merged | ||||
---|---|---|---|---|---|
Merged at revision: | 201 | ||||
Proposed branch: | lp:~corey.bryant/horizon/2014.1.4 | ||||
Merge into: | lp:~ubuntu-server-dev/horizon/icehouse | ||||
Diff against target: |
265 lines (+212/-9) 5 files modified
debian/changelog (+22/-0) debian/patches/fix-dashboard-django-wsgi.patch (+2/-2) debian/patches/fix-host-listing-live-migration.patch (+182/-0) debian/patches/fix-requirements.patch (+5/-7) debian/patches/series (+1/-0) |
||||
To merge this branch: | bzr merge lp:~corey.bryant/horizon/2014.1.4 | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
James Page | Approve | ||
Review via email: mp+253096@code.launchpad.net |
Commit message
Description of the change
- 201. By Corey Bryant
-
* Resynchronize with stable/icehouse (b14a2ec) (LP: #1432608):
- [4f12ca8] Fix metering daily display
- [e00979e] Use floats instead of integer in memory calculation of admin dashboard
- [0eef0d8] Removing Moscow's timezone check
- [c37aafa] Remove the urlquote to arguments passed to reverse
- [61d09f6] Horizon login page contains DOS attack mechanism
- [33f2b93] Prevent leaking `target` info into subsequent `policy.check()` calls
- [a04aa21] Tolerate completely missing floating_ips
- [ad1a893] Fixing Neutron Subnet Details help text
- [7dd9ca6] Handle negative values in total*Used for Cinder absolute limits
- [2b292e8] Workaround for negative vals in total*Used in nova absolute_limits
- [e5a9037] Update WSGI app creation to be compatible with Django 1.7
- [b14a2ec] Run router dashboard unit tests by default
* d/p/fix-dashboard- django- wsgi.patch: Rebased
* d/p/fix-requirements. patch: Rebased
* d/p/fix-host-listing- live-migration. patch: Cherry picked from
https://review. openstack. org/#/c/ 149621/
James Page (james-page) : | # |
Preview Diff
1 | === modified file 'debian/changelog' |
2 | --- debian/changelog 2014-12-03 19:01:02 +0000 |
3 | +++ debian/changelog 2015-03-16 19:14:28 +0000 |
4 | @@ -1,3 +1,25 @@ |
5 | +horizon (1:2014.1.4-0ubuntu1) UNRELEASED; urgency=medium |
6 | + |
7 | + * Resynchronize with stable/icehouse (b14a2ec) (LP: #1432608): |
8 | + - [4f12ca8] Fix metering daily display |
9 | + - [e00979e] Use floats instead of integer in memory calculation of admin dashboard |
10 | + - [0eef0d8] Removing Moscow's timezone check |
11 | + - [c37aafa] Remove the urlquote to arguments passed to reverse |
12 | + - [61d09f6] Horizon login page contains DOS attack mechanism |
13 | + - [33f2b93] Prevent leaking `target` info into subsequent `policy.check()` calls |
14 | + - [a04aa21] Tolerate completely missing floating_ips |
15 | + - [ad1a893] Fixing Neutron Subnet Details help text |
16 | + - [7dd9ca6] Handle negative values in total*Used for Cinder absolute limits |
17 | + - [2b292e8] Workaround for negative vals in total*Used in nova absolute_limits |
18 | + - [e5a9037] Update WSGI app creation to be compatible with Django 1.7 |
19 | + - [b14a2ec] Run router dashboard unit tests by default |
20 | + * d/p/fix-dashboard-django-wsgi.patch: Rebased |
21 | + * d/p/fix-requirements.patch: Rebased |
22 | + * d/p/fix-host-listing-live-migration.patch: Cherry picked from |
23 | + https://review.openstack.org/#/c/149621/ |
24 | + |
25 | + -- Corey Bryant <corey.bryant@canonical.com> Mon, 16 Mar 2015 14:34:38 -0400 |
26 | + |
27 | horizon (1:2014.1.3-0ubuntu2) trusty; urgency=medium |
28 | |
29 | * Fix Ubuntu theme region switcher dropdown (LP: #1396318) |
30 | |
31 | === modified file 'debian/patches/fix-dashboard-django-wsgi.patch' |
32 | --- debian/patches/fix-dashboard-django-wsgi.patch 2013-10-03 12:44:29 +0000 |
33 | +++ debian/patches/fix-dashboard-django-wsgi.patch 2015-03-16 19:14:28 +0000 |
34 | @@ -1,6 +1,6 @@ |
35 | --- a/openstack_dashboard/wsgi/django.wsgi |
36 | +++ b/openstack_dashboard/wsgi/django.wsgi |
37 | -@@ -9,6 +9,8 @@ sys.path.insert(0, os.path.join(os.path. |
38 | +@@ -9,6 +9,8 @@ |
39 | os.environ['DJANGO_SETTINGS_MODULE'] = 'openstack_dashboard.settings' |
40 | sys.stdout = sys.stderr |
41 | |
42 | @@ -8,4 +8,4 @@ |
43 | + |
44 | DEBUG = False |
45 | |
46 | - application = django.core.handlers.wsgi.WSGIHandler() |
47 | + application = get_wsgi_application() |
48 | |
49 | === added file 'debian/patches/fix-host-listing-live-migration.patch' |
50 | --- debian/patches/fix-host-listing-live-migration.patch 1970-01-01 00:00:00 +0000 |
51 | +++ debian/patches/fix-host-listing-live-migration.patch 2015-03-16 19:14:28 +0000 |
52 | @@ -0,0 +1,182 @@ |
53 | +Description: Fix host listing in live migration |
54 | +Author: Dirk Mueller<dirk@dmllr.de> |
55 | +Origin: Cherry picked from https://review.openstack.org/#/c/149621/ |
56 | +--- |
57 | + .../dashboards/admin/instances/forms.py | 7 ++-- |
58 | + .../dashboards/admin/instances/tests.py | 40 +++++++++++----------- |
59 | + .../dashboards/admin/instances/views.py | 4 +-- |
60 | + openstack_dashboard/test/test_data/nova_data.py | 10 ++++++ |
61 | + 4 files changed, 36 insertions(+), 25 deletions(-) |
62 | + |
63 | +diff --git a/openstack_dashboard/dashboards/admin/instances/forms.py b/openstack_dashboard/dashboards/admin/instances/forms.py |
64 | +index b13dce6..86da601 100644 |
65 | +--- a/openstack_dashboard/dashboards/admin/instances/forms.py |
66 | ++++ b/openstack_dashboard/dashboards/admin/instances/forms.py |
67 | +@@ -50,10 +50,11 @@ class LiveMigrateForm(forms.SelfHandlingForm): |
68 | + def populate_host_choices(self, request, initial): |
69 | + hosts = initial.get('hosts') |
70 | + current_host = initial.get('current_host') |
71 | +- host_list = [(host.hypervisor_hostname, |
72 | +- host.hypervisor_hostname) |
73 | ++ host_list = [(host.host_name, |
74 | ++ host.host_name) |
75 | + for host in hosts |
76 | +- if host.service['host'] != current_host] |
77 | ++ if host.service.startswith('compute') and |
78 | ++ host.host_name != current_host] |
79 | + if host_list: |
80 | + host_list.insert(0, ("", _("Select a new host"))) |
81 | + else: |
82 | +diff --git a/openstack_dashboard/dashboards/admin/instances/tests.py b/openstack_dashboard/dashboards/admin/instances/tests.py |
83 | +index abb98af..64276f8 100644 |
84 | +--- a/openstack_dashboard/dashboards/admin/instances/tests.py |
85 | ++++ b/openstack_dashboard/dashboards/admin/instances/tests.py |
86 | +@@ -221,14 +221,14 @@ class InstanceViewTest(test.BaseAdminViewTests): |
87 | + self.assertContains(res, "instances__revert") |
88 | + self.assertNotContains(res, "instances__migrate") |
89 | + |
90 | +- @test.create_stubs({api.nova: ('hypervisor_list', |
91 | ++ @test.create_stubs({api.nova: ('host_list', |
92 | + 'server_get',)}) |
93 | + def test_instance_live_migrate_get(self): |
94 | + server = self.servers.first() |
95 | + api.nova.server_get(IsA(http.HttpRequest), server.id) \ |
96 | + .AndReturn(server) |
97 | +- api.nova.hypervisor_list(IsA(http.HttpRequest)) \ |
98 | +- .AndReturn(self.hypervisors.list()) |
99 | ++ api.nova.host_list(IsA(http.HttpRequest)) \ |
100 | ++ .AndReturn(self.hosts.list()) |
101 | + |
102 | + self.mox.ReplayAll() |
103 | + |
104 | +@@ -252,13 +252,13 @@ class InstanceViewTest(test.BaseAdminViewTests): |
105 | + |
106 | + self.assertRedirectsNoFollow(res, INDEX_URL) |
107 | + |
108 | +- @test.create_stubs({api.nova: ('hypervisor_list', |
109 | ++ @test.create_stubs({api.nova: ('host_list', |
110 | + 'server_get',)}) |
111 | + def test_instance_live_migrate_list_hypervisor_get_exception(self): |
112 | + server = self.servers.first() |
113 | + api.nova.server_get(IsA(http.HttpRequest), server.id) \ |
114 | + .AndReturn(server) |
115 | +- api.nova.hypervisor_list(IsA(http.HttpRequest)) \ |
116 | ++ api.nova.host_list(IsA(http.HttpRequest)) \ |
117 | + .AndRaise(self.exceptions.nova) |
118 | + |
119 | + self.mox.ReplayAll() |
120 | +@@ -268,14 +268,14 @@ class InstanceViewTest(test.BaseAdminViewTests): |
121 | + |
122 | + self.assertRedirectsNoFollow(res, INDEX_URL) |
123 | + |
124 | +- @test.create_stubs({api.nova: ('hypervisor_list', |
125 | ++ @test.create_stubs({api.nova: ('host_list', |
126 | + 'server_get',)}) |
127 | + def test_instance_live_migrate_list_hypervisor_without_current(self): |
128 | + server = self.servers.first() |
129 | + api.nova.server_get(IsA(http.HttpRequest), server.id) \ |
130 | + .AndReturn(server) |
131 | +- api.nova.hypervisor_list(IsA(http.HttpRequest)) \ |
132 | +- .AndReturn(self.hypervisors.list()) |
133 | ++ api.nova.host_list(IsA(http.HttpRequest)) \ |
134 | ++ .AndReturn(self.hosts.list()) |
135 | + |
136 | + self.mox.ReplayAll() |
137 | + |
138 | +@@ -283,24 +283,25 @@ class InstanceViewTest(test.BaseAdminViewTests): |
139 | + args=[server.id]) |
140 | + res = self.client.get(url) |
141 | + self.assertNotContains( |
142 | +- res, "<option value=\"devstack003\">devstack003</option>") |
143 | ++ res, "<option value=\"instance-host\">devstack004</option>") |
144 | + self.assertContains( |
145 | + res, "<option value=\"devstack001\">devstack001</option>") |
146 | +- self.assertContains( |
147 | ++ self.assertNotContains( |
148 | + res, "<option value=\"devstack002\">devstack002</option>") |
149 | ++ self.assertContains( |
150 | ++ res, "<option value=\"devstack003\">devstack003</option>") |
151 | + |
152 | +- @test.create_stubs({api.nova: ('hypervisor_list', |
153 | ++ @test.create_stubs({api.nova: ('host_list', |
154 | + 'server_get', |
155 | + 'server_live_migrate',)}) |
156 | + def test_instance_live_migrate_post(self): |
157 | + server = self.servers.first() |
158 | +- hypervisor = self.hypervisors.first() |
159 | +- host = hypervisor.hypervisor_hostname |
160 | ++ host = self.hosts.first().host_name |
161 | + |
162 | + api.nova.server_get(IsA(http.HttpRequest), server.id) \ |
163 | + .AndReturn(server) |
164 | +- api.nova.hypervisor_list(IsA(http.HttpRequest)) \ |
165 | +- .AndReturn(self.hypervisors.list()) |
166 | ++ api.nova.host_list(IsA(http.HttpRequest)) \ |
167 | ++ .AndReturn(self.hosts.list()) |
168 | + api.nova.server_live_migrate(IsA(http.HttpRequest), server.id, host, |
169 | + block_migration=False, |
170 | + disk_over_commit=False) \ |
171 | +@@ -314,18 +315,17 @@ class InstanceViewTest(test.BaseAdminViewTests): |
172 | + self.assertNoFormErrors(res) |
173 | + self.assertRedirectsNoFollow(res, INDEX_URL) |
174 | + |
175 | +- @test.create_stubs({api.nova: ('hypervisor_list', |
176 | ++ @test.create_stubs({api.nova: ('host_list', |
177 | + 'server_get', |
178 | + 'server_live_migrate',)}) |
179 | + def test_instance_live_migrate_post_api_exception(self): |
180 | + server = self.servers.first() |
181 | +- hypervisor = self.hypervisors.first() |
182 | +- host = hypervisor.hypervisor_hostname |
183 | ++ host = self.hosts.first().host_name |
184 | + |
185 | + api.nova.server_get(IsA(http.HttpRequest), server.id) \ |
186 | + .AndReturn(server) |
187 | +- api.nova.hypervisor_list(IsA(http.HttpRequest)) \ |
188 | +- .AndReturn(self.hypervisors.list()) |
189 | ++ api.nova.host_list(IsA(http.HttpRequest)) \ |
190 | ++ .AndReturn(self.hosts.list()) |
191 | + api.nova.server_live_migrate(IsA(http.HttpRequest), server.id, host, |
192 | + block_migration=False, |
193 | + disk_over_commit=False) \ |
194 | +diff --git a/openstack_dashboard/dashboards/admin/instances/views.py b/openstack_dashboard/dashboards/admin/instances/views.py |
195 | +index 54f41ce..4d2358d 100644 |
196 | +--- a/openstack_dashboard/dashboards/admin/instances/views.py |
197 | ++++ b/openstack_dashboard/dashboards/admin/instances/views.py |
198 | +@@ -143,10 +143,10 @@ class LiveMigrateView(forms.ModalFormView): |
199 | + @memoized.memoized_method |
200 | + def get_hosts(self, *args, **kwargs): |
201 | + try: |
202 | +- return api.nova.hypervisor_list(self.request) |
203 | ++ return api.nova.host_list(self.request) |
204 | + except Exception: |
205 | + redirect = reverse("horizon:admin:instances:index") |
206 | +- msg = _('Unable to retrieve hypervisor information.') |
207 | ++ msg = _('Unable to retrieve host information.') |
208 | + exceptions.handle(self.request, msg, redirect=redirect) |
209 | + |
210 | + @memoized.memoized_method |
211 | +diff --git a/openstack_dashboard/test/test_data/nova_data.py b/openstack_dashboard/test/test_data/nova_data.py |
212 | +index 56cd698..26206e1 100644 |
213 | +--- a/openstack_dashboard/test/test_data/nova_data.py |
214 | ++++ b/openstack_dashboard/test/test_data/nova_data.py |
215 | +@@ -730,6 +730,16 @@ def data(TEST): |
216 | + "zone": "testing" |
217 | + } |
218 | + ) |
219 | ++ |
220 | ++ host4 = hosts.Host(hosts.HostManager(None), |
221 | ++ { |
222 | ++ "host_name": "devstack004", |
223 | ++ "service": "compute", |
224 | ++ "zone": "testing", |
225 | ++ } |
226 | ++ ) |
227 | ++ |
228 | + TEST.hosts.add(host1) |
229 | + TEST.hosts.add(host2) |
230 | + TEST.hosts.add(host3) |
231 | ++ TEST.hosts.add(host4) |
232 | +-- |
233 | +2.1.0 |
234 | + |
235 | |
236 | === modified file 'debian/patches/fix-requirements.patch' |
237 | --- debian/patches/fix-requirements.patch 2014-06-13 15:46:13 +0000 |
238 | +++ debian/patches/fix-requirements.patch 2015-03-16 19:14:28 +0000 |
239 | @@ -1,13 +1,11 @@ |
240 | Description: Set min version of six. |
241 | Author: Corey Bryant <corey.bryant@canonical.com> |
242 | Forwarded: Not needed. |
243 | -Index: horizon/requirements.txt |
244 | -=================================================================== |
245 | ---- horizon.orig/requirements.txt 2014-06-13 10:14:00.816555621 -0400 |
246 | -+++ horizon/requirements.txt 2014-06-13 11:44:13.180390616 -0400 |
247 | -@@ -21,4 +21,4 @@ |
248 | - python-swiftclient>=1.6 |
249 | - python-troveclient>=1.0.3 |
250 | +--- a/requirements.txt |
251 | ++++ b/requirements.txt |
252 | +@@ -22,4 +22,4 @@ |
253 | + python-swiftclient>=1.6,<=2.3.1 |
254 | + python-troveclient>=1.0.3,<=1.0.8 |
255 | pytz>=2010h |
256 | -six>=1.6.0 |
257 | +six>=1.5.2 |
258 | |
259 | === modified file 'debian/patches/series' |
260 | --- debian/patches/series 2014-06-13 15:46:13 +0000 |
261 | +++ debian/patches/series 2015-03-16 19:14:28 +0000 |
262 | @@ -1,3 +1,4 @@ |
263 | +fix-host-listing-live-migration.patch |
264 | fix-dashboard-django-wsgi.patch |
265 | fix-dashboard-manage.patch |
266 |