flags.FLAGS( crashes bpython

Bug #915039 reported by Vish Ishaya
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
Vish Ishaya
openstack-common
Fix Released
Undecided
Mark McLoughlin

Bug Description

Bpython tries to do some fancy stuff like lookup obj.__name__ and check for AttributeError. The code in common/cfg.py has a special getattr that raises a non AttributeError exception so it leads to a crash and stack trace in bpython:

Traceback (most recent call last):
  File "/usr/local/share/python/bpython", line 9, in <module>
    load_entry_point('bpython==0.10.1', 'console_scripts', 'bpython')()
  File "/usr/local/Cellar/python/2.7.2/lib/python2.7/site-packages/bpython/cli.py", line 1756, in main
    banner=banner)
  File "/usr/local/Cellar/python/2.7.2/lib/python2.7/site-packages/bpython/cli.py", line 1658, in curses_wrapper
    return func(stdscr, *args, **kwargs)
  File "/usr/local/Cellar/python/2.7.2/lib/python2.7/site-packages/bpython/cli.py", line 1727, in main_curses
    clirepl.repl()
  File "/usr/local/Cellar/python/2.7.2/lib/python2.7/site-packages/bpython/cli.py", line 1015, in repl
    inp = self.get_line()
  File "/usr/local/Cellar/python/2.7.2/lib/python2.7/site-packages/bpython/cli.py", line 600, in get_line
    if self.p_key(key) is None:
  File "/usr/local/Cellar/python/2.7.2/lib/python2.7/site-packages/bpython/cli.py", line 911, in p_key
    self.addstr(key)
  File "/usr/local/Cellar/python/2.7.2/lib/python2.7/site-packages/bpython/cli.py", line 290, in addstr
    self.complete()
  File "/usr/local/Cellar/python/2.7.2/lib/python2.7/site-packages/bpython/cli.py", line 383, in complete
    self.list_win_visible = repl.Repl.complete(self, tab)
  File "/usr/local/Cellar/python/2.7.2/lib/python2.7/site-packages/bpython/repl.py", line 540, in complete
    if not self.get_args():
  File "/usr/local/Cellar/python/2.7.2/lib/python2.7/site-packages/bpython/repl.py", line 511, in get_args
    self.argspec = inspection.getargspec(func, f)
  File "/usr/local/Cellar/python/2.7.2/lib/python2.7/site-packages/bpython/inspection.py", line 229, in getargspec
    func_name = getattr(f, '__name__', None)
  File "nova/flags.py", line 114, in __getattr__
    return getattr(self._conf, name)
  File "nova/common/cfg.py", line 777, in __getattr__
    return self._substitute(self._get(name))
  File "nova/common/cfg.py", line 930, in _get
    info = self._get_opt_info(name, group)
  File "nova/common/cfg.py", line 1010, in _get_opt_info
    raise NoSuchOptError(opt_name, group)
nova.common.cfg.NoSuchOptError: no such option: __name__

To test, you do:
bpython
then at prompt:
>>> from nova import flags
>>> flags.FLAGS(

Tags: cfg
Changed in nova:
status: New → In Progress
importance: Undecided → Low
assignee: nobody → Vish Ishaya (vishvananda)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/2980

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/2980
Committed: http://github.com/openstack/nova/commit/4d01531f91e4b20db2cb6ff738ee9af724ed2bf1
Submitter: Jenkins
Branch: master

commit 4d01531f91e4b20db2cb6ff738ee9af724ed2bf1
Author: Vishvananda Ishaya <email address hidden>
Date: Wed Jan 11 13:22:36 2012 -0800

    Makes common/cfg.py raise AttributeError

     * fixes bug 915039
     * includes test

    Change-Id: I67b886be3b5af3763f52fffe54085975d61d61eb

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → essex-3
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to openstack-common (master)

Fix proposed to branch: master
Review: https://review.openstack.org/3721

Changed in openstack-common:
assignee: nobody → Mark McLoughlin (markmc)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to openstack-common (master)

Reviewed: https://review.openstack.org/3721
Committed: http://github.com/openstack/openstack-common/commit/d383f78f8ca27eaf982d150fd8c955f8bd451690
Submitter: Jenkins
Branch: master

commit d383f78f8ca27eaf982d150fd8c955f8bd451690
Author: Vishvananda Ishaya <email address hidden>
Date: Thu Feb 2 23:25:53 2012 +0000

    Makes common/cfg.py raise AttributeError

      * fixes bug 915039
      * includes test

    Change-Id: I67b886be3b5af3763f52fffe54085975d61d61eb

Changed in openstack-common:
status: In Progress → Fix Committed
Mark McLoughlin (markmc)
tags: added: cfg
Thierry Carrez (ttx)
Changed in nova:
milestone: essex-3 → 2012.1
Mark McLoughlin (markmc)
Changed in openstack-common:
status: Fix Committed → Fix Released
milestone: none → 2012.1
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.