glance-manage db_sync fails with "no such option: add_group"

Bug #904863 reported by Johannes Erdfelt
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Glance
Fix Released
Critical
Édouard Thuleau

Bug Description

In trunk, glance-manage db_sync fails with an exception similar to this:

johannes@compute4:~/openstack/glance/trunk$ ../dbsync.sh
Traceback (most recent call last):
  File "/home/johannes/openstack/glance/trunk/bin/glance-manage", line 128, in <module>
    main()
  File "/home/johannes/openstack/glance/trunk/bin/glance-manage", line 114, in main
    glance.registry.db.add_options(conf)
  File "/home/johannes/openstack/glance/trunk/glance/registry/db/__init__.py", line 30, in add_options
    conf.add_group(cfg.OptGroup('registrydb',
  File "/home/johannes/openstack/glance/trunk/glance/common/cfg.py", line 777, in __getattr__
    return self._substitute(self._get(name))
  File "/home/johannes/openstack/glance/trunk/glance/common/cfg.py", line 930, in _get
    info = self._get_opt_info(name, group)
  File "/home/johannes/openstack/glance/trunk/glance/common/cfg.py", line 1010, in _get_opt_info
    raise NoSuchOptError(opt_name, group)
glance.common.cfg.NoSuchOptError: no such option: add_group

It appears that add_group should be register_group.

However, even if that is fixed, further errors with an unknown group keyword argument generates another exception. That is a trickier problem to solve since the docstrings at the top of glance/common/cfg.py say that the group keyword should be fine however the implementation in cfg.py doesn't appear to match the documentation.

Thierry Carrez (ttx)
Changed in glance:
importance: Undecided → Critical
milestone: none → essex-2
status: New → Confirmed
Revision history for this message
Thierry Carrez (ttx) wrote :

Only in trunk.

Changed in glance:
milestone: essex-2 → none
Revision history for this message
Édouard Thuleau (ethuleau) wrote :
Changed in glance:
assignee: nobody → Édouard Thuleau (ethuleau)
status: Confirmed → Fix Released
Revision history for this message
Édouard Thuleau (ethuleau) wrote :

Oops, I made a mistake when I change the bug status and I cannot come back to the original status.

Changed in glance:
status: Fix Released → In Progress
Revision history for this message
Édouard Thuleau (ethuleau) wrote :

Johannes Erdfelt said me:

default= can't be the right choice there. 'registrydb' isn't a valid SQL connection string and it appears the original intent was to include the option as part of the 'registrydb' group.

I abandoned the review https://review.openstack.org/#change,2420

Revision history for this message
Brian Lamar (blamar) wrote :

I have a very similar fix to the one proposed yesterday. This seems to work for me in my test environment. Any feedback is helpful as I'm not sure I understand exactly what is going on here :)

https://review.openstack.org/#change,2451

Revision history for this message
Openstack Gerrit (openstack-gerrit) wrote : Fix merged to glance (master)

Reviewed: https://review.openstack.org/2451
Committed: http://github.com/openstack/glance/commit/1239f61c2b4ddad3087a2e4e59824fd000c5760e
Submitter: Jenkins
Branch: master

 status fixcommitted
 done

commit 1239f61c2b4ddad3087a2e4e59824fd000c5760e
Author: Brian Lamar <email address hidden>
Date: Sat Dec 17 15:11:14 2011 -0500

    Updated glance.registry.db for bug 904863

    Changed sql-connection to sql_connection, updated add_group to register_group,
    and removed the 'registrydb' group designator.

    Change-Id: Id9bf38f067806b6f81b23296ed73774e820a577b

Changed in glance:
status: In Progress → Fix Committed
Jay Pipes (jaypipes)
Changed in glance:
milestone: none → essex-3
Thierry Carrez (ttx)
Changed in glance:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in glance:
milestone: essex-3 → 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.