confusing code snippet when registers all standard API extensions
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
Low
|
Joe Gordon |
Bug Description
nova/api/
for dirpath, dirnames, filenames in os.walk(our_dir):
# Compute the relative package name from the dirpath
relpath = os.path.
if relpath == '.':
relpkg = ''
else:
relpkg = '.%s' % '.'.join(
# Now, consider each file in turn, only considering .py files
for fname in filenames:
root, ext = os.path.
# Skip __init__ and anything that's not .py
if ext != '.py' or root == '__init__':
# Try loading it
if ext_list is not None and classname not in ext_list:
try:
except Exception as exc:
# Now, let's consider any subdirectories we may have...
subdirs = []
for dname in dirnames:
# Skip it if it does not have __init__.py
if not os.path.
# If it has extension(), delegate...
try:
ext = importutils.
except ImportError:
# extension() doesn't exist on it, so we'll explore
# the directory for ourselves
else:
# Update the list of directories we'll explore...
dirnames[:] = subdirs >>>>this is unused, so we can remove subdirs
Changed in nova: | |
assignee: | nobody → hougangliu (liuhoug) |
assignee: | hougangliu (liuhoug) → nobody |
Changed in nova: | |
status: | New → Confirmed |
importance: | Undecided → Low |
Changed in nova: | |
milestone: | none → kilo-1 |
status: | Fix Committed → Fix Released |
Changed in nova: | |
milestone: | kilo-1 → 2015.1.0 |
Fix proposed to branch: master /review. openstack. org/140028
Review: https:/