@@ -3050,10 +3050,14 @@ def test_get(self, mock_get_context, mock_get_machine_type):
30503050 def test_get_unknown_failure (
30513051 self , mock_get_context , mock_get_machine_type
30523052 ):
3053- mock_get_machine_type .side_effect = Exception ()
3053+ mock_get_machine_type .side_effect = Exception ('oops' )
30543054 ret = self .commands .get_machine_type (
30553055 instance_uuid = uuidsentinel .instance
30563056 )
3057+ output = self .output .getvalue ().strip ()
3058+ self .assertIn (
3059+ 'Unexpected error, see nova-manage.log for the full trace: oops' ,
3060+ output )
30573061 self .assertEqual (1 , ret )
30583062
30593063 @mock .patch ('nova.virt.libvirt.machine_type_utils.get_machine_type' )
@@ -3145,11 +3149,15 @@ def test_update_force(self, mock_get_context, mock_update):
31453149 @mock .patch ('nova.virt.libvirt.machine_type_utils.update_machine_type' )
31463150 @mock .patch ('nova.context.get_admin_context' , new = mock .Mock ())
31473151 def test_update_unknown_failure (self , mock_update ):
3148- mock_update .side_effect = Exception ()
3152+ mock_update .side_effect = Exception ('oops' )
31493153 ret = self .commands .update_machine_type (
31503154 instance_uuid = uuidsentinel .instance ,
31513155 machine_type = mock .sentinel .machine_type
31523156 )
3157+ output = self .output .getvalue ().strip ()
3158+ self .assertIn (
3159+ 'Unexpected error, see nova-manage.log for the full trace: oops' ,
3160+ output )
31533161 self .assertEqual (1 , ret )
31543162
31553163 @mock .patch ('nova.virt.libvirt.machine_type_utils.update_machine_type' )
@@ -3269,9 +3277,13 @@ def test_list_unset_machine_type_none_found(
32693277 def test_list_unset_machine_type_unknown_failure (
32703278 self , mock_get_context , mock_get_instances
32713279 ):
3272- mock_get_instances .side_effect = Exception ()
3280+ mock_get_instances .side_effect = Exception ('oops' )
32733281 ret = self .commands .list_unset_machine_type (
32743282 cell_uuid = uuidsentinel .cell_uuid )
3283+ output = self .output .getvalue ().strip ()
3284+ self .assertIn (
3285+ 'Unexpected error, see nova-manage.log for the full trace: oops' ,
3286+ output )
32753287 self .assertEqual (1 , ret )
32763288
32773289 @mock .patch (
0 commit comments