[openstack-dev] [nova] [glance] Getting the ball rolling on glance v2 in nova in newton cycle

Jay Pipes jaypipes at gmail.com
Fri Apr 15 14:42:05 UTC 2016


On 04/01/2016 06:45 AM, Sean Dague wrote:
> #2 - move discover major version back to glanceclient -
> https://github.com/openstack/nova/blob/3cdaa30566c17a2add5d9163a0693c97dc1d065b/nova/image/glance.py#L108
>
> I don't understand why this was ever in nova. This really should be
>
> glanceclient.discover... something. It uses internal methods from
> glanceclient and internal structures of the content returned.
>
> Catching, if desired, should also be on the glanceclient side.
> glanceclient.reset_version() could exist to clear any caching.

This is exactly what I said in the original review in Mitaka :(

https://review.openstack.org/#/c/222150/

Note that on PS10 I wrote:

This code belongs in glanceclient, not Nova, IMHO...

Line 169: Most of the above code should actually be in the 
python-glanceclient package, not here. The Nova code should be able to 
call glanceclient with a URI and get the latest supported Glance API 
version.

and then later I said:

To be a little clearer... the Nova code should be able to do something 
like this:

  glance_uris = CONF.glance_api_servers
  glance_uri_version_map = {glance_uri: glanceclient.get_latest_version(uri)
             for uri in glance_uris}

So... pretty much in line with what you say above.

Flavio then responded to me:

"While I agree with you, I believe we should let this in "for now" 
whilst it's added to glanceclient. One of the things that blocked the 
previous work during the Kilo cycle were things being added to 
glanceclient and the fact that they weren't available right away.

Can we agree on removing this code as soon as there's a glanceclient 
release with it? Happy to have a bug filed against glanceclient. The 
glance team will take care of this."

and I wrote:

"OK, if you promise to remove some of this code when glanceclient gets 
this functionality, then I suppose I'm good with this going in Nova for 
now."

So, there's your answer to "why this was ever in Nova".

Best,
-jay



More information about the OpenStack-dev mailing list