technical debt: replace a location_stragegy test

Bug #1686764 reported by Brian Rosmaita
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Triaged
Medium
Unassigned

Bug Description

Here's the situation.

There was a discussion during the Newton-Ocata time frame about whether glance supports custom location_strategy modules. We decided that it does not, and at that time used the 'choices' parameter in the location_strategy api config option (defined using oslo.config) to restrict the names the option could take to the two location strategy modules that come with glance. There's code that checks to make sure the module set by the config module actually exists. We had a test for this that used an override in oslo.config to set the location_strategy option to something like 'invalid_module' and then tested to make sure the missing module was handled properly. In the meantime, oslo.config has removed the ability to do this kind of override. So the test has to be changed.

We don't have bandwidth to get into this right now, so I'm filing this bug to remind us to go back and fix this when someone has time. Here's the patch that removes the test:
https://review.openstack.org/#/c/457050/

Revision history for this message
Sean McGinnis (sean-mcginnis) wrote :

I think this can actually be closed. Since the config option enforces input now, and the only defined acceptable input are the two options that we know are good, it actually looks like this code isn't needed anymore and can just be removed.

Revision history for this message
Brian Rosmaita (brian-rosmaita) wrote :

@Sean: it's a bit more complicated than that. As you point out, misconfiguration of the option is prevented by the 'choices' parameter when the option is defined, so we're OK there. The test that was removed made sure that Glance handled a missing module gracefully (because it's possible for an operator to configure the option with the correct name, but not have the module present). The easiest way to test that was to make up a module name that wouldn't be found, but that's blocked now by the change to oslo.config. So I think we do need the code there (and we do know it did work before the change to oslo.config); it's just that we need to come up with some way to test it.

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.