Merge "Add missing argument to delete_keys method"
This commit is contained in:
		@@ -262,8 +262,8 @@ class QoSSpecsController(wsgi.Controller):
 | 
				
			|||||||
        try:
 | 
					        try:
 | 
				
			||||||
            qos_specs.delete_keys(context, id, keys)
 | 
					            qos_specs.delete_keys(context, id, keys)
 | 
				
			||||||
            notifier_info = dict(id=id)
 | 
					            notifier_info = dict(id=id)
 | 
				
			||||||
            rpc.get_notifier().info(context, 'qos_specs.delete_keys',
 | 
					            rpc.get_notifier('QoSSpecs').info(context, 'qos_specs.delete_keys',
 | 
				
			||||||
                                    notifier_info)
 | 
					                                              notifier_info)
 | 
				
			||||||
        except exception.QoSSpecsNotFound as err:
 | 
					        except exception.QoSSpecsNotFound as err:
 | 
				
			||||||
            notifier_err = dict(id=id, error_message=err)
 | 
					            notifier_err = dict(id=id, error_message=err)
 | 
				
			||||||
            self._notify_qos_specs_error(context,
 | 
					            self._notify_qos_specs_error(context,
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -274,6 +274,18 @@ class QoSSpecManageApiTest(test.TestCase):
 | 
				
			|||||||
                              req, '666', body)
 | 
					                              req, '666', body)
 | 
				
			||||||
            self.assertEqual(1, notifier.get_notification_count())
 | 
					            self.assertEqual(1, notifier.get_notification_count())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @mock.patch('cinder.volume.qos_specs.delete_keys',
 | 
				
			||||||
 | 
					                side_effect=return_qos_specs_delete_keys)
 | 
				
			||||||
 | 
					    def test_qos_specs_delete_keys_get_notifier(self, mock_qos_delete_keys):
 | 
				
			||||||
 | 
					        body = {"keys": ['bar', 'zoo']}
 | 
				
			||||||
 | 
					        req = fakes.HTTPRequest.blank('/v2/fake/qos-specs/666/delete_keys')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        notifier = fake_notifier.get_fake_notifier()
 | 
				
			||||||
 | 
					        with mock.patch('cinder.rpc.get_notifier', return_value=notifier,
 | 
				
			||||||
 | 
					                        autospec=True) as mock_get_notifier:
 | 
				
			||||||
 | 
					            self.controller.delete_keys(req, '666', body)
 | 
				
			||||||
 | 
					            mock_get_notifier.assert_called_once_with('QoSSpecs')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @mock.patch('cinder.volume.qos_specs.create',
 | 
					    @mock.patch('cinder.volume.qos_specs.create',
 | 
				
			||||||
                side_effect=return_qos_specs_create)
 | 
					                side_effect=return_qos_specs_create)
 | 
				
			||||||
    @mock.patch('cinder.volume.qos_specs.get_qos_specs_by_name',
 | 
					    @mock.patch('cinder.volume.qos_specs.get_qos_specs_by_name',
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user