← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1199354] Re: remove inappropriate assert() usage

 

** Changed in: glance
       Status: Fix Committed => Fix Released

** Changed in: glance
    Milestone: None => kilo-3

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

Title:
  remove inappropriate assert() usage

Status in Cinder:
  Fix Released
Status in OpenStack Image Registry and Delivery Service (Glance):
  Fix Released
Status in OpenStack Neutron (virtual network service):
  Won't Fix
Status in OpenStack Compute (Nova):
  Fix Released

Bug description:
  There are few places in nova where asserts are used in inappropriate
  manner. The example is below.

      for option in ['memory_mb', 'vcpus']:
          try:
              assert int(str(kwargs[option])) > 0
              kwargs[option] = int(kwargs[option])
          except (ValueError, AssertionError, TypeError):
              msg = _("'%s' argument must be a positive integer") % option
              raise exception.InvalidInput(reason=msg)

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