Image building with --all is broken

Bug #1595616 reported by Ben Nemec
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
python-openstackclient
Fix Released
Medium
Unassigned
tripleo
Fix Released
Critical
Unassigned

Bug Description

Using the latest master branch, it is not possible to use --all to build all images. It fails like this:

$ openstack overcloud image build --all
[help output]
openstack overcloud image build: error: one of the arguments --all --type --builder is required

This is obviously bogus. It turns out that it is caused by a recent designateclient commit: https://review.openstack.org/#/c/324002/ The --all-projects option conflicts with our --all due to argparse abbreviation functionality.

According to the OSC team, those options should not have been added globally, but should be limited in scope to just the designate commands. As I understand it, this may very well break other OSC commands as well because --all and --all-projects are not uncommon option names.

Revision history for this message
Ben Nemec (bnemec) wrote :

Since we don't actually need designateclient on the undercloud, the simplest workaround for tripleo is probably to `rpm -e --nodeps python-designateclient` before building images.

Revision history for this message
Alan Pevec (apevec) wrote :

RFE for OSC: warning when options conflict

Revision history for this message
Steve Martinelli (stevemar) wrote :
Revision history for this message
Ben Nemec (bnemec) wrote :

I've proposed a revert of the change in designateclient: https://review.openstack.org/#/c/333518/

Revision history for this message
Dean Troyer (dtroyer) wrote :

The problem of argparse partial matching is well known, and is almost always a conflict between OSC global and command-level options parsers. Plugins registering globals outside the plugin-specific (and namespaced) options were not anticipated and thus not documented as a risky move. We will do that now. FWIW, this is also one reason most global OSC options are prefixed with '--os-'.

To follow up Ben's comment above, rather than registering global options, designateclient needs to register those options on each command. Identity v3 has a similar issue and provides a good design pattern for this in how the domain options are handled in a common module.

Testing for option conflicts is going to have to be done in OSC functional tests when all known plugins are installed/loaded. Each plugin will need to implement a callable test to check its own commands and options. This will be an extension of the existing command resource checking already done in the OSC repo. We may ask plugins to also run that job so conflicts are detected before merges happen.

Changed in python-openstackclient:
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
Ben Nemec (bnemec) wrote :

The revert has merged to designateclient, so this is resolved for TripleO. Thanks everybody!

Changed in tripleo:
status: Triaged → Fix Released
Changed in python-openstackclient:
status: Triaged → Fix Released
no longer affects: designate
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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