components/openstack/nova/patches/11-launchpad-1377644.patch
changeset 5405 66fd59fecd68
parent 5404 55e409ba4e72
child 5406 5ac656f02914
equal deleted inserted replaced
5404:55e409ba4e72 5405:66fd59fecd68
     1 This external patch was a follow up fix to Launchpad bug 1377644.
       
     2 While the original fix was backported to Juno 2014.2.1, the subsequent
       
     3 one was not.
       
     4 
       
     5 commit 64882d39d9fea9d6001ccc61973624949825c52f
       
     6 Author: He Jie Xu <[email protected]>
       
     7 Date:   Fri Nov 7 23:24:12 2014 +0800
       
     8 
       
     9     Fix circular reference error when live migration failed
       
    10     
       
    11     When unexpected exception raised in live migration, the MigrationError
       
    12     carry another original exception in it. But when oslo.message
       
    13     serialize the exception, the circular reference error happended. This
       
    14     patch just pass the exception as unicode string into MigrationError.
       
    15     
       
    16     Change-Id: I4e449baae74bd9a15490ae7accbd2103bae90d57
       
    17     Related-Bug: #1377644
       
    18 
       
    19 --- nova-2014.2.2/nova/conductor/manager.py.~1~	2015-12-01 04:52:25.839270759 -0800
       
    20 +++ nova-2014.2.2/nova/conductor/manager.py	2015-12-01 04:54:08.341268026 -0800
       
    21 @@ -589,7 +589,7 @@ class ComputeTaskManager(base.Base):
       
    22                         ' %(dest)s unexpectedly failed.'),
       
    23                         {'instance_id': instance['uuid'], 'dest': destination},
       
    24                         exc_info=True)
       
    25 -            raise exception.MigrationError(reason=ex)
       
    26 +            raise exception.MigrationError(reason=six.text_type(ex))
       
    27  
       
    28      def build_instances(self, context, instances, image, filter_properties,
       
    29              admin_password, injected_files, requested_networks,
       
    30 --- nova-2014.2.2/nova/tests/conductor/test_conductor.py.~1~	2015-02-05 06:26:50.000000000 -0800
       
    31 +++ nova-2014.2.2/nova/tests/conductor/test_conductor.py	2015-12-01 04:55:27.135695264 -0800
       
    32 @@ -20,6 +20,7 @@ import contextlib
       
    33  import mock
       
    34  import mox
       
    35  from oslo import messaging
       
    36 +import six
       
    37  
       
    38  from nova.api.ec2 import ec2utils
       
    39  from nova.compute import arch
       
    40 @@ -1711,18 +1712,19 @@ class ConductorTaskTestCase(_BaseTaskTes
       
    41          self.mox.StubOutWithMock(scheduler_utils,
       
    42                  'set_vm_state_and_notify')
       
    43  
       
    44 -        ex = IOError()
       
    45 +        expected_ex = IOError('fake error')
       
    46          live_migrate.execute(self.context, mox.IsA(objects.Instance),
       
    47                               'destination', 'block_migration',
       
    48 -                             'disk_over_commit').AndRaise(ex)
       
    49 +                             'disk_over_commit').AndRaise(expected_ex)
       
    50          self.mox.ReplayAll()
       
    51  
       
    52          self.conductor = utils.ExceptionHelper(self.conductor)
       
    53  
       
    54 -        self.assertRaises(exc.MigrationError,
       
    55 +        ex = self.assertRaises(exc.MigrationError,
       
    56              self.conductor.migrate_server, self.context, inst_obj,
       
    57              {'host': 'destination'}, True, False, None, 'block_migration',
       
    58              'disk_over_commit')
       
    59 +        self.assertEqual(ex.kwargs['reason'], six.text_type(expected_ex))
       
    60  
       
    61      def test_set_vm_state_and_notify(self):
       
    62          self.mox.StubOutWithMock(scheduler_utils,