← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1776187] [NEW] Workflow unregister raises unexpected exception when worklfow is not registered

 

Public bug reported:

This is seen as of Change-Id: I347d113f47587932e4f583d3152e781ad1a4849f
on master/Rocky:

When unregistering a workflow there used to be a catched exception
horizon/workflows/base.py:

        try:
            cls._cls_registry.remove(step_class)
        except KeyError:
            raise base.NotRegistered('%s is not registered' % cls)
        return cls._unregister(step_class)


However since the change _cls_registry changed from a set to a list, making the error a ValueError instead of a KeyError.

class WorkflowMetaclass(type):
    def __new__(mcs, name, bases, attrs):
        super(WorkflowMetaclass, mcs).__new__(mcs, name, bases, attrs)
        attrs["_cls_registry"] = []
        return type.__new__(mcs, name, bases, attrs)

** Affects: horizon
     Importance: Undecided
         Status: New

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

Title:
  Workflow unregister raises unexpected exception when worklfow is not
  registered

Status in OpenStack Dashboard (Horizon):
  New

Bug description:
  This is seen as of Change-Id:
  I347d113f47587932e4f583d3152e781ad1a4849f on master/Rocky:

  When unregistering a workflow there used to be a catched exception
  horizon/workflows/base.py:

          try:
              cls._cls_registry.remove(step_class)
          except KeyError:
              raise base.NotRegistered('%s is not registered' % cls)
          return cls._unregister(step_class)

  
  However since the change _cls_registry changed from a set to a list, making the error a ValueError instead of a KeyError.

  class WorkflowMetaclass(type):
      def __new__(mcs, name, bases, attrs):
          super(WorkflowMetaclass, mcs).__new__(mcs, name, bases, attrs)
          attrs["_cls_registry"] = []
          return type.__new__(mcs, name, bases, attrs)

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


Follow ups