@@ -3050,10 +3050,14 @@ def test_get(self, mock_get_context, mock_get_machine_type):
3050
3050
def test_get_unknown_failure (
3051
3051
self , mock_get_context , mock_get_machine_type
3052
3052
):
3053
- mock_get_machine_type .side_effect = Exception ()
3053
+ mock_get_machine_type .side_effect = Exception ('oops' )
3054
3054
ret = self .commands .get_machine_type (
3055
3055
instance_uuid = uuidsentinel .instance
3056
3056
)
3057
+ output = self .output .getvalue ().strip ()
3058
+ self .assertIn (
3059
+ 'Unexpected error, see nova-manage.log for the full trace: oops' ,
3060
+ output )
3057
3061
self .assertEqual (1 , ret )
3058
3062
3059
3063
@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):
3145
3149
@mock .patch ('nova.virt.libvirt.machine_type_utils.update_machine_type' )
3146
3150
@mock .patch ('nova.context.get_admin_context' , new = mock .Mock ())
3147
3151
def test_update_unknown_failure (self , mock_update ):
3148
- mock_update .side_effect = Exception ()
3152
+ mock_update .side_effect = Exception ('oops' )
3149
3153
ret = self .commands .update_machine_type (
3150
3154
instance_uuid = uuidsentinel .instance ,
3151
3155
machine_type = mock .sentinel .machine_type
3152
3156
)
3157
+ output = self .output .getvalue ().strip ()
3158
+ self .assertIn (
3159
+ 'Unexpected error, see nova-manage.log for the full trace: oops' ,
3160
+ output )
3153
3161
self .assertEqual (1 , ret )
3154
3162
3155
3163
@mock .patch ('nova.virt.libvirt.machine_type_utils.update_machine_type' )
@@ -3269,9 +3277,13 @@ def test_list_unset_machine_type_none_found(
3269
3277
def test_list_unset_machine_type_unknown_failure (
3270
3278
self , mock_get_context , mock_get_instances
3271
3279
):
3272
- mock_get_instances .side_effect = Exception ()
3280
+ mock_get_instances .side_effect = Exception ('oops' )
3273
3281
ret = self .commands .list_unset_machine_type (
3274
3282
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 )
3275
3287
self .assertEqual (1 , ret )
3276
3288
3277
3289
@mock .patch (
0 commit comments