From 569e463f02b0a631d341b06849217657a22c4569 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Antal?= Date: Mon, 7 Nov 2016 17:22:34 +0100 Subject: [PATCH] Fix a TypeError in notification_sample_base.py In notification_sample_base, a possible error is found and fixed, as extra_params['return_reservation_id'] = True is a valid code only when extra_params is not None. However, this is not checked. So when we try to boot a server without extra parameters, a TypeError is raised: TypeError: 'NoneType' object does not support item assignment In this patchset, the possible bug is fixed. Change-Id: I80e2286b231da39b8c1e4225145422ac48daee68 --- .../notification_sample_tests/notification_sample_base.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/nova/tests/functional/notification_sample_tests/notification_sample_base.py b/nova/tests/functional/notification_sample_tests/notification_sample_base.py index a3e208ea5931..f82bb6490ae7 100644 --- a/nova/tests/functional/notification_sample_tests/notification_sample_base.py +++ b/nova/tests/functional/notification_sample_tests/notification_sample_base.py @@ -152,9 +152,8 @@ class NotificationSampleTestBase(test.TestCase, image_uuid='155d900f-4e14-4e4c-a73d-069cbf4541e6', flavor_id=flavor_id) - extra_params['return_reservation_id'] = True - if extra_params: + extra_params['return_reservation_id'] = True server.update(extra_params) post = {'server': server}