Earlier  
Posted Nick Remark
#openstack-nova - 2021-06-02
16:19:27 sean-k-mooney so the auto complete code will need to handel that
16:19:31 sean-k-mooney stephenfin: gibi ^
16:21:23 sean-k-mooney i would gues that OSC itself is passing None for the session to osc_placment
16:24:15 rm_work that'd make sense I guess -- not sure what else it could reasonably pass
16:24:32 rm_work and it'd expect the client to deal with that in this case but placement made a different assumption
16:24:41 rm_work though again, not a change on the placement side I think?
16:24:56 rm_work since I can't find any code in osc-placement that has changed since like 2019 lol
16:25:43 sean-k-mooney we merged that auto negocaation code about last week or the week before
16:25:43 rm_work maybe should bring this up in thee client channel
16:25:47 rm_work oh, k
16:26:28 rm_work wait where is that
16:27:24 sean-k-mooney so this is causing the get to rfail https://github.com/openstack/osc-placement/blob/37e47afc88b188a338e3cb70adcf87bac513d4ef/osc_placement/version.py#L142
16:28:19 sean-k-mooney the allocation endpoing and like all the rest is chanck the api version and seeing if it supprot things
16:28:27 sean-k-mooney File "/Users/rm_work/.pyenv/versions/3.9.5/envs/osc2/lib/python3.9/site-packages/osc_placement/resources/allocation.py", line 90, in get_parser
16:28:29 sean-k-mooney required=self.compare_version(version.ge('1.8'))
16:28:49 sean-k-mooney so the allocation class is using the compare_version mixin
16:28:51 gibi rm_work, sean-k-mooney: I've just confirmed locally that 3.0.0 break the completion, while 2.2.0 still works
16:29:18 gibi so it is pretty likely that the microversion negotiation break it as that is the only thing we merged in 3.0.0
16:29:37 sean-k-mooney doing obj.app.client_manager.placement.api_version tries to actully connect to placement to do the version negocation
16:29:53 sean-k-mooney which cant work since bash completion will not have your auth details
16:30:09 sean-k-mooney well not the auth deatials but it wont have the cloud endpoint
16:30:18 sean-k-mooney form cloud.yaml
16:30:31 rm_work yeah ideally it should work completely offline (same as "help")
16:30:44 sean-k-mooney this would proably work if you exproted the env vars for the keystone endpoint
16:30:53 sean-k-mooney like the openrc did
16:31:04 sean-k-mooney rm_work: yes it should
16:31:44 sean-k-mooney so here we catrch AttributeError
16:31:46 sean-k-mooney https://github.com/openstack/osc-placement/blob/37e47afc88b188a338e3cb70adcf87bac513d4ef/osc_placement/version.py#L143
16:32:08 sean-k-mooney but we are rasing exceptions.PluginAttributeError
16:32:51 sean-k-mooney https://github.com/openstack/osc-lib/blob/master/osc_lib/clientmanager.py#L49
16:33:59 sean-k-mooney really we should just check if we have a session and if not returnt true
16:34:16 sean-k-mooney well
16:35:04 sean-k-mooney if not obj.app.client_manager.session: return SUPPORTED_VERSIONS[0]
16:35:17 sean-k-mooney here https://github.com/openstack/osc-placement/blob/master/osc_placement/version.py#L141
16:36:01 sean-k-mooney actully maybe SUPPORTED_VERSIONS[-1] would be better
16:36:22 sean-k-mooney we have a choice of assume oldest or newest microversion for completion
16:36:33 sean-k-mooney newset might be best
16:36:59 sean-k-mooney gibi: do you think ^ is a vaild approch
16:37:44 gibi sean-k-mooney: agree, for completion just assume the newest supported
16:38:20 sean-k-mooney rm_work: you could proably work around this by changing the complation command used in bash
16:38:42 sean-k-mooney to pass --os-placment-api-version or whatever that flag is to the openstack client
16:38:49 sean-k-mooney as a tempory hack
16:40:40 sean-k-mooney gibi: actully if you just run "openstack complete" you get "ould not clean up: 'ClientManager' object has no attribute 'sdk_connection'"
16:40:42 sean-k-mooney at the end
16:41:03 gibi that last error comes from 2.2.0 as well
16:41:08 gibi but it does not break completion I think
16:41:13 gibi or is it?
16:44:11 rm_work yeah i've noticed that for a long time, not sure if that's placement related
16:44:21 rm_work and no, it didn't break completion
16:45:06 sean-k-mooney correct it does not but it does point to the fact that this is a general problem with the complete command
16:45:54 sean-k-mooney in at least the cleanup path its trying to unconditonally clean up the sdk connection that is never established
16:46:54 rm_work yeah
16:49:12 sean-k-mooney rm_work: can you try invoking complete but passing --os-cloud
16:49:25 rm_work uhh sure
16:49:34 rm_work I do have OS_CLOUD exported, FWIW
16:49:47 sean-k-mooney oh in that case never mind
16:50:01 rm_work and yeah no difference
16:50:02 sean-k-mooney i was wondering if we told it what cloud to sue woudl the normal auth kick in
16:50:24 rm_work what is an example `--os-placment-api-version` i could try btw
16:50:49 rm_work well, typed a random number and it works
16:51:01 rm_work `openstack complete --os-placement-api-version 1.2`
16:51:10 sean-k-mooney ya caus its disabling the negocation
16:51:15 rm_work yep
16:51:23 rm_work just confirming your theory for that too
16:51:43 sean-k-mooney thats the workaround for now more or less
16:52:03 rm_work ok, LMK if there's something I can help review :)
16:52:28 sean-k-mooney im just going to push something quickly
16:52:38 rm_work i can test whatever locally
16:56:09 opendevreview sean mooney proposed openstack/osc-placement master: [WIP] default to max version when no session https://review.opendev.org/c/openstack/osc-placement/+/794276
16:57:11 rm_work some other client actually IS trying to do auth I think... i have to yubi-key to do `openstack complete` lol
16:57:20 opendevreview melanie witt proposed openstack/nova stable/wallaby: Honor [neutron]http_retries in the manual client https://review.opendev.org/c/openstack/nova/+/794186
16:57:36 opendevreview sean mooney proposed openstack/osc-placement master: [WIP] default to max version when no session https://review.opendev.org/c/openstack/osc-placement/+/794276
16:59:00 sean-k-mooney rm_work: ya as i said you would have to specificaly code for this with auto negociation
16:59:10 rm_work hmmm
16:59:15 rm_work `ValueError: invalid version number '1'`
16:59:19 rm_work with your patch
16:59:28 rm_work not sure exactly why
17:00:19 rm_work http://paste.openstack.org/show/806286/
17:00:30 rm_work logically your fix seems right
17:00:35 sean-k-mooney https://github.com/openstack/osc-placement/blob/master/osc_placement/version.py#L18
17:00:41 sean-k-mooney it is getting that
17:00:50 sean-k-mooney because of https://github.com/openstack/osc-placement/blob/master/osc_placement/version.py#L52
17:00:59 sean-k-mooney let me try MAX_VERSION_NO_GAP
17:01:08 rm_work OH yeah I see
17:01:40 rm_work I misread SUPPORTED_MICROVERSIONS as SUPPORTED_VERSIONS
17:01:40 opendevreview sean mooney proposed openstack/osc-placement master: [WIP] default to max version when no session https://review.opendev.org/c/openstack/osc-placement/+/794276
17:02:11 sean-k-mooney ya so did i when i wrote it
17:02:21 sean-k-mooney i ment to get the last supported microveris
17:02:39 rm_work k looks good
17:03:14 sean-k-mooney i might change it back to SUPPORTED_MICROVERSIONS[-1] but does that seam to fix it
17:03:30 rm_work this seems like it accomplishes your goal pretty explicitly
17:03:38 rm_work since you wanted ... that
17:03:40 rm_work max version
17:04:24 melwitt stephenfin: are you interested in +W-ing the placement re-parenting spec? https://review.opendev.org/c/openstack/nova-specs/+/788243
17:04:37 opendevreview Balazs Gibizer proposed openstack/nova master: Detect extended_resource_request neutron API extension https://review.opendev.org/c/openstack/nova/+/793618
17:04:38 opendevreview Balazs Gibizer proposed openstack/nova master: [func test] neutron fixture for extended resource request https://review.opendev.org/c/openstack/nova/+/794306
17:04:38 opendevreview Balazs Gibizer proposed openstack/nova master: Reject server create with extended resource req https://review.opendev.org/c/openstack/nova/+/793619
17:04:58 sean-k-mooney rm_work: ok well i can see if we can turn that into a proper patch with some tests
17:05:07 rm_work well I +1'd
17:05:09 rm_work lol

Earlier   Later