← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1264052] Re: Optimize code, delete a try statement

 

sorry, this bug is in neutron project, not in glance project, I report a bug in Neutron:
https://bugs.launchpad.net/neutron/+bug/1264054

** Changed in: glance
       Status: New => Invalid

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to Glance.
https://bugs.launchpad.net/bugs/1264052

Title:
  Optimize code, delete a try statement

Status in OpenStack Image Registry and Delivery Service (Glance):
  Invalid

Bug description:
  The method serve_wsgi() in /neutron/neutron/service.py have two  try statemens to capture exceptions,as follows:
  def serve_wsgi(cls):

      try:
          try:
              service = cls.create()
              service.start()
          except RuntimeError:
              LOG.exception(_('Error occurred: trying old api-paste.ini.'))
              service = cls.create('quantum')
              service.start()
      except Exception:
          LOG.exception(_('Unrecoverable error: please check log for details.'))
          raise

  it can be optimized and modified as:
  def serve_wsgi(cls):

      try:
          service = cls.create()
          service.start()
      except RuntimeError:
          LOG.exception(_('Error occurred: trying old api-paste.ini.'))
          service = cls.create('quantum')
          service.start()
      except Exception:
          LOG.exception(_('Unrecoverable error: please check log for details.'))
          raise

      return service

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


References