** Changed in: nova/liberty
       Status: Fix Committed => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1564551

Title:
  initialize_connection failure can result in 'exceptions.TypeError'
  object has no attribute 'code'

Status in OpenStack Compute (nova):
  Fix Released
Status in OpenStack Compute (nova) liberty series:
  Fix Released
Status in OpenStack Compute (nova) mitaka series:
  Fix Committed

Bug description:
  Doing an initialize_connection() results in the following partial code
  stack:

  2016-03-29 06:51:06.882 25713 ERROR nova.compute.manager [instance: 
4c8d25b3-b136-4c72-a381-4b80dcca5c49]   File 
"/usr/lib/python2.7/dist-packages/nova/volume/cinder.py", line 232, in wrapper
  2016-03-29 06:51:06.882 25713 ERROR nova.compute.manager [instance: 
4c8d25b3-b136-4c72-a381-4b80dcca5c49]     res = method(self, ctx, *args, 
**kwargs)
  2016-03-29 06:51:06.882 25713 ERROR nova.compute.manager [instance: 
4c8d25b3-b136-4c72-a381-4b80dcca5c49]   File 
"/usr/lib/python2.7/dist-packages/nova/volume/cinder.py", line 259, in wrapper
  2016-03-29 06:51:06.882 25713 ERROR nova.compute.manager [instance: 
4c8d25b3-b136-4c72-a381-4b80dcca5c49]     res = method(self, ctx, volume_id, 
*args, **kwargs)
  2016-03-29 06:51:06.882 25713 ERROR nova.compute.manager [instance: 
4c8d25b3-b136-4c72-a381-4b80dcca5c49]   File 
"/usr/lib/python2.7/dist-packages/nova/volume/cinder.py", line 437, in 
initialize_connection
  2016-03-29 06:51:06.882 25713 ERROR nova.compute.manager [instance: 
4c8d25b3-b136-4c72-a381-4b80dcca5c49]     'code': exc.code})
  2016-03-29 06:51:06.882 25713 ERROR nova.compute.manager [instance: 
4c8d25b3-b136-4c72-a381-4b80dcca5c49] AttributeError: 'exceptions.TypeError' 
object has no attribute 'code'

  
  Here is the method:

      @translate_volume_exception
      def initialize_connection(self, context, volume_id, connector):
          try:
              connection_info = cinderclient(
                  context).volumes.initialize_connection(volume_id, connector)
              connection_info['connector'] = connector
              return connection_info
          except cinder_exception.ClientException as ex:
              with excutils.save_and_reraise_exception():
                  LOG.error(_LE('Initialize connection failed for volume '
                                '%(vol)s on host %(host)s. Error: %(msg)s '
                                'Code: %(code)s. Attempting to terminate '
                                'connection.'),
                            {'vol': volume_id,
                             'host': connector.get('host'),
                             'msg': six.text_type(ex),
                             'code': ex.code})
                  try:
                      self.terminate_connection(context, volume_id, connector)
                  except Exception as exc:
                      LOG.error(_LE('Connection between volume %(vol)s and host 
'
                                    '%(host)s might have succeeded, but attempt 
'
                                    'to terminate connection has failed. '
                                    'Validate the connection and determine if '
                                    'manual cleanup is needed. Error: %(msg)s '
                                    'Code: %(code)s.'),
                                {'vol': volume_id,
                                 'host': connector.get('host'),
                                 'msg': six.text_type(exc),
                                 'code': exc.code})               <---------- 
blows up

      @translate_volume_exception
      def terminate_connection(self, context, volume_id, connector):
          return cinderclient(context).volumes.terminate_connection(volume_id,
                                                                    connector)

  Presumably the issue has to do with the @translate_volume_exception
  decorator on terminate_connection()....so when that fails, the
  exception that is re-raised is not constructed with a 'code' value (?)

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1564551/+subscriptions

-- 
Mailing list: https://launchpad.net/~yahoo-eng-team
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~yahoo-eng-team
More help   : https://help.launchpad.net/ListHelp

Reply via email to