← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1538518] Re: Avoid using `len(x)` to check if x is empty

 

** Also affects: nova
   Importance: Undecided
       Status: New

** Changed in: nova
     Assignee: (unassigned) => Ren Qiaowei (qiaowei-ren)

** Changed in: nova
       Status: New => In Progress

** Also affects: swift
   Importance: Undecided
       Status: New

** Changed in: swift
     Assignee: (unassigned) => Ren Qiaowei (qiaowei-ren)

** Changed in: swift
       Status: New => In Progress

** Also affects: glance
   Importance: Undecided
       Status: New

** Changed in: glance
     Assignee: (unassigned) => Ren Qiaowei (qiaowei-ren)

** Changed in: glance
       Status: New => In Progress

** Also affects: cinder
   Importance: Undecided
       Status: New

** Changed in: cinder
     Assignee: (unassigned) => Ren Qiaowei (qiaowei-ren)

** Changed in: cinder
       Status: New => In Progress

** Also affects: ceilometer
   Importance: Undecided
       Status: New

** Changed in: ceilometer
     Assignee: (unassigned) => Ren Qiaowei (qiaowei-ren)

** Changed in: ceilometer
       Status: New => In Progress

** Also affects: neutron
   Importance: Undecided
       Status: New

** Changed in: neutron
     Assignee: (unassigned) => Ren Qiaowei (qiaowei-ren)

** Changed in: neutron
       Status: New => In Progress

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

Title:
  Avoid using `len(x)` to check if x is empty

Status in Ceilometer:
  In Progress
Status in Cinder:
  In Progress
Status in Glance:
  In Progress
Status in neutron:
  In Progress
Status in OpenStack Compute (nova):
  In Progress
Status in Rally:
  In Progress
Status in OpenStack Object Storage (swift):
  In Progress

Bug description:
  `len()` is used to check if collection (e.g., a dict, list, set, etc.)
  has items. As collections have a boolean representation too, it is
  better to directly check for true / false.

  rally/common/utils.py
  rally/task/utils.py
  rally/task/validation.py
  tests/unit/doc/test_specs.py

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