Monday, 2017-09-04

*** slaweq has joined #openstack-shade00:45
*** slaweq has quit IRC00:51
*** gkadam has joined #openstack-shade03:48
*** gouthamr has quit IRC05:41
*** slaweq has joined #openstack-shade05:51
*** slaweq has quit IRC05:56
*** slaweq has joined #openstack-shade06:52
*** slaweq has quit IRC06:57
*** slaweq has joined #openstack-shade07:03
*** ioggstream has joined #openstack-shade07:44
*** slaweq has quit IRC08:09
*** slaweq has joined #openstack-shade08:09
*** slaweq has quit IRC08:20
*** slaweq has joined #openstack-shade09:21
*** slaweq has quit IRC09:26
*** slaweq has joined #openstack-shade10:22
*** slaweq has quit IRC10:27
*** slaweq has joined #openstack-shade11:41
*** slaweq has quit IRC11:48
*** gkadam has quit IRC12:02
samueldmqmorning shade12:05
mordredmorning samueldmq !13:01
samueldmqmordred: o/13:01
samueldmqmordred: I found a bug in shade13:07
samueldmq404's are turned into OpenStackCloudURINotFound, which is not *always* true, e.g user not found in group returns 40413:08
samueldmqe.g http://logs.openstack.org/57/499357/4/check/gate-shade-functional/4ac1cda/console.html#_2017-09-02_21_12_33_39027313:08
mordredsamueldmq: well, that's one of the downsides to REST - a 404 is, by definition, URI Not Found. :)13:12
samueldmqD:13:12
mordredsamueldmq: however, before we were catching keystoneauth1.exceptions.http.NotFound in that method, and now we just need to catch OpenStackCloudURINotFound instead13:13
mordred(and the other two excepts there can go away, they're not needed anymore)13:14
samueldmqmordred: ok so I can handle taht and add a comment "we're sure this url exists ..... so a 404 means user not in group in this case ...."13:14
mordred++13:14
samueldmqmordred: I also need to check on specific entities that do not exist in v2.0. e.g groups13:15
samueldmqcalling is_user_in_group when only v2.0 is available should throw an exception, not just say "false"13:15
mordredsamueldmq: agree13:16
mordredoh - also - we have the ability to do something now13:16
mordredsamueldmq: (I'd almost forgotten why getting shade to consume ksa version discovery was so important ...)13:16
openstackgerritMonty Taylor proposed openstack-infra/shade master: WIP Force keystone v2 admin call to admin interface  https://review.openstack.org/50054013:17
mordredsamueldmq: this ^^13:17
mordredsamueldmq: the admin calls in keystone v2 are all supposed to be made against the admin endpoint13:17
mordredwe didn't have a way to force that before, because of how we were making the client objects13:18
mordredsamueldmq: but with ksa and letting ksa do the versiondiscovery for us - we can now just add an endpoint_filter={'interface': 'admin'} to calls that need to be v2 admin13:18
samueldmqmordred: well, we've been doing some of that already13:18
samueldmqe.g https://review.openstack.org/#/c/482197/3/shade/operatorcloud.py13:18
samueldmq:)13:19
mordredsamueldmq: oh good ... and it worked? :)13:19
samueldmqmordred: I trusted you :-) how can I check it?13:19
mordredoh! duh. this has been possible with keystone for a while ... because keystoneauth has known how to do version discovery for keystone the whole time13:20
* mordred is still waking up13:20
samueldmq:)13:32
openstackgerritSamuel de Medeiros Queiroz proposed openstack-infra/shade master: De-client-ify Check User in Group  https://review.openstack.org/49935713:39
openstackgerritSamuel de Medeiros Queiroz proposed openstack-infra/shade master: De-client-ify Check User in Group  https://review.openstack.org/49935713:42
openstackgerritSamuel de Medeiros Queiroz proposed openstack-infra/shade master: De-client-ify Remove User from Group  https://review.openstack.org/49936013:43
*** slaweq has joined #openstack-shade13:50
mordredsamueldmq: WE'RE SO CLOSE13:54
samueldmqmordred: :D and what's the missing bit?13:54
*** slaweq has quit IRC13:55
mordredsamueldmq: if you feel like it, in a follow up patch I think in https://review.openstack.org/#/c/499357/6/shade/openstackcloud.py you can also delete the except Exception: clause - the only exception that should be thrown from that is from the adapter already13:57
mordredbut the patch looks great13:57
mordredsamueldmq: roles and endpoints are the only ones left13:58
samueldmqmordred: ++ I am looking at them, hopefully I can get the rest of the patches this week14:00
openstackgerritMonty Taylor proposed openstack-infra/shade master: Remove use of legacy keystone client in functional tests  https://review.openstack.org/50055814:02
openstackgerritSamuel de Medeiros Queiroz proposed openstack-infra/shade master: Remove improper exc handling in is_user_in_group  https://review.openstack.org/50056014:03
samueldmqmordred: ^14:03
samueldmqsweet!14:03
mordredTheJulia: you saw the use-new-ksa patch landed right? so you can now call "self._baremetal_client.get_endpoint_data" and get an object that will tell you min and max microversion available - and you can pass microversion= in all of your rest calls - like self._baremetal_client.get('/foo', microversion='1.10')14:39
TheJuliaNo I didn't see that, but awesome. Out of curiosity, what does it default to if no version is defined?14:42
TheJuliathe client constructor, that is14:43
openstackgerritMerged openstack-infra/shade master: De-client-ify User Update  https://review.openstack.org/49928414:45
mordredTheJulia: it defaults to not sending any microversions14:46
mordredTheJulia: actually - let me restate that ...14:46
mordredTheJulia: the client constructor by default has no relationship with microversions at all14:46
mordredbecaues microversions are a per-REST call construct14:47
mordredHOWEVER14:47
mordredyou can pass a default_microversion parameter to the Adapter constructor which will cause it to behave as-if you had added microversion=blah to each REST call14:47
mordredI think this mightbe a thing we want to do for ironic since you have a default min microversion you need, right?14:48
TheJuliamordred: yeah, and I take it that explicitly stating it overrides the default?14:48
*** slaweq has joined #openstack-shade14:51
* TheJulia ponders14:55
*** slaweq has quit IRC14:56
mordredyes15:08
mordredTheJulia: explicitly stating always wins15:08
mordredTheJulia: the overall intent is that in the general case specifying default_microversion is not what you should do - as it's a per-call thing, generally speaking you want to say "I want version 1.15 of GET /machines"15:09
mordredBUT ... that's theory - in practice there are things like "zomg never use less than ironic microversion 1.3"15:09
mordredor even "shade does not support ironic that doesn't have at least microversion 1.3"15:10
mordredand if that was the case, we could do a check for min_microversion from self._baremetal_client.get_endpoint_data when we create self._baremetal_client and throw an exception if the cloud doens't have it15:10
mordredbecause better do that upfront and say "sorry, your cloud is too old we literally cannot deal with it"15:10
mordredthan to get halfway into an operation then hit the point where 1.3 is super necessary and we can't deal with it not being there and THEN tell people they're hosed15:11
TheJuliayeah, microversions make it _fun_.  Not sure the best way to do it efficently, although there is still the cost of negotiating a desired microversion.  Perhaps thats a something to add and leverage moving forward.... :\15:11
TheJuliayeah15:11
mordredTheJulia: this is an interesting concept in the context of shade, since for us we don't want to expose them to users, we want to use them to find if we can do more advanced things15:11
mordredTheJulia: well - 2 things on negotiation - one is that the version info is cached at the top of the session,so we only fetch it once during version discovery15:12
TheJuliahmmmmm15:13
mordredTheJulia: that said, I have a spec I need to update that involves providing an extremely cachable cloud-level document with all of the microversion of all of the services - although that doesn't hepl the bifrost case15:13
TheJuliayeah, a couple variables to consider15:14
mordredTheJulia: we could also add support for locally caching version documents based on time and/or etag15:14
mordredit's a bunch of fun15:14
mordredfor now I'm mostly trying to make sure that we have the consumption api in keystoneauth so that getting available versions and then requesting one per request works15:14
mordredeven if it's not 100% as efficient as it could be15:14
mordredcaues then we can improve caching/efficiency under the covers in ksa15:15
mordredand get the logic right once15:15
openstackgerritPaul Belanger proposed openstack-infra/shade master: Add openstack-doc-build to shade  https://review.openstack.org/50020115:27
*** gkadam has joined #openstack-shade15:35
*** gouthamr has joined #openstack-shade15:37
*** slaweq has joined #openstack-shade15:52
*** slaweq has quit IRC15:56
*** gkadam has quit IRC16:50
*** gkadam has joined #openstack-shade16:51
*** slaweq has joined #openstack-shade16:53
TheJuliamordred: I feel like the definition of "fun" needs to be checked/verified.16:54
*** slaweq has quit IRC16:58
*** gkadam has quit IRC17:07
*** slaweq has joined #openstack-shade17:54
mordredTheJulia: :)17:56
*** slaweq has quit IRC17:58
*** gouthamr has quit IRC18:19
*** ioggstream has quit IRC18:19
*** gouthamr has joined #openstack-shade18:20
* TheJulia finally starts pondering microversions again18:29
*** kmalloc_ has joined #openstack-shade18:30
*** slaweq has joined #openstack-shade18:31
*** slaweq has quit IRC18:32
*** kmalloc has quit IRC18:37
*** RuiChen has quit IRC18:37
*** kmalloc_ is now known as kmalloc18:37
*** pabelanger has quit IRC19:17
*** pabelanger has joined #openstack-shade19:17
openstackgerritMonty Taylor proposed openstack-infra/shade master: De-client-ify Add User to Group  https://review.openstack.org/49934519:20
openstackgerritMonty Taylor proposed openstack-infra/shade master: De-client-ify Check User in Group  https://review.openstack.org/49935719:21
openstackgerritMonty Taylor proposed openstack-infra/shade master: De-client-ify Remove User from Group  https://review.openstack.org/49936019:21
openstackgerritMonty Taylor proposed openstack-infra/shade master: Remove use of legacy keystone client in functional tests  https://review.openstack.org/50055819:21
openstackgerritMonty Taylor proposed openstack-infra/shade master: Remove improper exc handling in is_user_in_group  https://review.openstack.org/50056019:21
*** slaweq has joined #openstack-shade19:33
*** slaweq has quit IRC19:38
*** ioggstream has joined #openstack-shade19:45
*** RuiChen has joined #openstack-shade20:25
*** slaweq has joined #openstack-shade20:34
*** slaweq has quit IRC20:39
*** slaweq has joined #openstack-shade20:42
*** slaweq has quit IRC21:02
openstackgerritMerged openstack-infra/shade master: De-client-ify Add User to Group  https://review.openstack.org/49934521:05
*** ioggstream has quit IRC21:14
TheJuliamordred: so it looks like version discovery would just have to become the default (looks like it is presently false) to get the top level stored data in the session, and then each high level call in shade could just call an internal helper could be called with some minimum data that in a sense could actually provide very verbose error messaging about minimum versions if the endpoint is insufficient. Aside21:18
TheJuliafrom that, the client can just be a versioned client attempting to negotiate version.latest which avoids minimum versions being pulled and explicitly errored upon one day.21:18
TheJuliashade just has to have the logic, to navigate breaking changes, or preference behavior on the cached data21:19
mordredTheJulia: totally21:19
TheJuliaactually, I think it could be invoked in get_endpoint, if I'm remembering correctly....21:25
* TheJulia is not seeing a downside or a horrible caveat21:25
mordredTheJulia: so -because I know you want more work on your plate ...21:44
TheJulia....21:44
TheJuliacan this be over some sort of tasty beverage in denver?21:44
mordred:)21:44
TheJuliaspeaking of denver...21:45
TheJuliathe wind is putting new mexico to shame21:45
mordredTheJulia: instead of mocking the baremetal_client, what would be great is converting the mocks of ironic_client in shade/tests/unit/test_shade_operator.py to use requests_mock - that way it's mocking at the low-level requests Session level21:45
TheJuliayeah.... that has been in the back of my brain. I need to wrap my head around it further21:46
mordredhttps://review.openstack.org/#/c/474841 is an example of having done it for some nova calls21:47
mordred(I'm an example person myself)21:47
mordredmain key is that you call self.register_uris for the test with a list of the REST calls you expect the test to make - then remove all mocking of ironic_client methods, and requests_mock does the rest21:48
TheJulia\o/ an example21:48
mordred(self.assert_calls() at the end ensures that all the calls got made and in the order you expected)21:48
TheJuliaI guess that works, and as the logic changes, evolve the expected calls21:49
mordredhttps://review.openstack.org/#/c/474841/3/shade/tests/unit/test_server_delete_metadata.py is a good file to look at21:49
mordredyah. it's helpful as part of this process because you can update the test underneath ironicclient - so you can be sure the new test is correct - then when you change the code to move from ironic_client to baremetal_client - the test should be able to not change in the same patch21:50
mordredoh - https://review.openstack.org/#/c/474841/3/shade/tests/unit/test_server_set_metadata.py has an exampleof a thing that's good to know too ...21:50
mordredin test_server_set_metadata_with_exception you'll see the call then a "validate=dict(" thing - that is used to validate payloads sent to the cloud21:51
mordredso dict(method='GET', uri=self.get_mock_url('compute', 'public', append=['servers', 'detail']),json={'servers': [self.fake_server]}) says "if I do GET /servers/detail on the public endpoint of the compute service - return {'servers': [self.fake_server]}21:52
mordredbut the validate= call says, return {} to the library when I make that POST call, but make sure the library sent {'metadata': {'meta': 'data'}} as the payload21:53
mordred(and you can do headers and url params and whatnot too, if they're important)21:53
TheJuliahmm, okay, I guess I was trying to avoid hooking the existing client up to it, but it does make sense.21:54
openstackgerritMerged openstack-infra/shade master: De-client-ify Check User in Group  https://review.openstack.org/49935722:59

Generated by irclog2html.py 2.15.3 by Marius Gedminas - find it at mg.pov.lt!