← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1696605] [NEW] TypeError: unorderable types: int() < NoneType() possible during quota limit check

 

Public bug reported:

Saw this on a recent py35 unit test run [1]:

Traceback (most recent call last):
  File "/home/jenkins/workspace/gate-nova-python35/nova/tests/unit/network/test_manager.py", line 1234, in test_allocate_floating_ip
    self.network.allocate_floating_ip(ctxt, ctxt.project_id)
  File "/home/jenkins/workspace/gate-nova-python35/nova/network/floating_ips.py", line 223, in allocate_floating_ip
    project_id)
  File "/home/jenkins/workspace/gate-nova-python35/.tox/py35/lib/python3.5/site-packages/oslo_versionedobjects/base.py", line 184, in wrapper
    result = fn(cls, context, *args, **kwargs)
  File "/home/jenkins/workspace/gate-nova-python35/nova/objects/quotas.py", line 201, in check_deltas
    cls.limit_check_project_and_user(context, **check_kwargs)
  File "/home/jenkins/workspace/gate-nova-python35/.tox/py35/lib/python3.5/site-packages/oslo_versionedobjects/base.py", line 184, in wrapper
    result = fn(cls, context, *args, **kwargs)
  File "/home/jenkins/workspace/gate-nova-python35/nova/objects/quotas.py", line 136, in limit_check_project_and_user
    project_id=project_id, user_id=user_id)
  File "/home/jenkins/workspace/gate-nova-python35/nova/quota.py", line 1639, in limit_check_project_and_user
    user_values=user_values, project_id=project_id, user_id=user_id)
  File "/home/jenkins/workspace/gate-nova-python35/nova/quota.py", line 628, in limit_check_project_and_user
    overs = [key for key, val in merged_values.items()
  File "/home/jenkins/workspace/gate-nova-python35/nova/quota.py", line 629, in <listcomp>
    if merged_quotas[key] >= 0 and merged_quotas[key] < val]
TypeError: unorderable types: int() < NoneType()

The problem is some logic that tries to .get(key) a value from one of
two dicts that contains the key [2] and if the found value is 0, it
won't take precedence over a default not found value of None. In the
case where None is picked, we end up with a merged value of None, which
blows up (thankfully) in Python 3.

[1] http://logs.openstack.org/42/446242/18/check/gate-nova-python35/fdf57fc/testr_results.html.gz
[2] https://github.com/openstack/nova/blob/c7afbb9/nova/quota.py#L613-L614

** Affects: nova
     Importance: Undecided
     Assignee: melanie witt (melwitt)
         Status: In Progress


** Tags: quotas

-- 
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/1696605

Title:
  TypeError: unorderable types: int() < NoneType() possible during quota
  limit check

Status in OpenStack Compute (nova):
  In Progress

Bug description:
  Saw this on a recent py35 unit test run [1]:

  Traceback (most recent call last):
    File "/home/jenkins/workspace/gate-nova-python35/nova/tests/unit/network/test_manager.py", line 1234, in test_allocate_floating_ip
      self.network.allocate_floating_ip(ctxt, ctxt.project_id)
    File "/home/jenkins/workspace/gate-nova-python35/nova/network/floating_ips.py", line 223, in allocate_floating_ip
      project_id)
    File "/home/jenkins/workspace/gate-nova-python35/.tox/py35/lib/python3.5/site-packages/oslo_versionedobjects/base.py", line 184, in wrapper
      result = fn(cls, context, *args, **kwargs)
    File "/home/jenkins/workspace/gate-nova-python35/nova/objects/quotas.py", line 201, in check_deltas
      cls.limit_check_project_and_user(context, **check_kwargs)
    File "/home/jenkins/workspace/gate-nova-python35/.tox/py35/lib/python3.5/site-packages/oslo_versionedobjects/base.py", line 184, in wrapper
      result = fn(cls, context, *args, **kwargs)
    File "/home/jenkins/workspace/gate-nova-python35/nova/objects/quotas.py", line 136, in limit_check_project_and_user
      project_id=project_id, user_id=user_id)
    File "/home/jenkins/workspace/gate-nova-python35/nova/quota.py", line 1639, in limit_check_project_and_user
      user_values=user_values, project_id=project_id, user_id=user_id)
    File "/home/jenkins/workspace/gate-nova-python35/nova/quota.py", line 628, in limit_check_project_and_user
      overs = [key for key, val in merged_values.items()
    File "/home/jenkins/workspace/gate-nova-python35/nova/quota.py", line 629, in <listcomp>
      if merged_quotas[key] >= 0 and merged_quotas[key] < val]
  TypeError: unorderable types: int() < NoneType()

  The problem is some logic that tries to .get(key) a value from one of
  two dicts that contains the key [2] and if the found value is 0, it
  won't take precedence over a default not found value of None. In the
  case where None is picked, we end up with a merged value of None,
  which blows up (thankfully) in Python 3.

  [1] http://logs.openstack.org/42/446242/18/check/gate-nova-python35/fdf57fc/testr_results.html.gz
  [2] https://github.com/openstack/nova/blob/c7afbb9/nova/quota.py#L613-L614

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


Follow ups