Monday, 2017-04-03

*** VW_ has quit IRC03:45
*** VW has joined #craton03:46
*** VW has quit IRC05:16
*** openstackgerrit has quit IRC08:03
*** klindgren has quit IRC10:22
*** klindgren has joined #craton10:23
*** VW has joined #craton11:35
*** VW has quit IRC12:12
thomasemGoooood morning13:37
jimbakerthomasem, morning!13:46
anonymikeo/13:56
*** VW has joined #craton14:10
*** Syed__ has joined #craton14:41
jimbakerso we will have our usual meeting in a couple of minutes14:58
jimbakerexpect it to be short/pro forma14:58
jimbakeri will start the process of canceling them out as we figure out transition14:58
*** Tamayo has joined #craton15:37
anonymikerelocating15:39
thomasemMmmmmkay15:42
*** VW has quit IRC15:46
*** VW has joined #craton15:46
sulosorry i missed todays meeting but looks like good decisions made16:21
jimbakersulo, np, and thanks for reviewing those decisions16:55
*** Syed__ has quit IRC16:55
*** harlowja has joined #craton18:12
anonymikethomasem: was host-list --detail ever working?19:33
thomasemanonymike: It should have been https://github.com/openstack/python-cratonclient/blob/master/cratonclient/shell/v1/hosts_shell.py#L144, but I can't remember testing it specifically.19:34
anonymikei just spun up a new env and I keep getting ERROR: The request sent to the server was invalid.  when passing --detail19:35
thomasemInteresting19:35
thomasemOH19:35
thomasemHold up19:35
anonymikei fixed it in my code by setting it to details19:35
anonymikebut even then the variables aren't printing out :/19:35
thomasem... details in the API request?19:35
thomasemWhat was being passed to the API?19:36
anonymike"detail"19:36
anonymiketo get it to not error i changed to "details"19:36
thomasemWhat about for, say, regions-list --detail?19:36
anonymikehttps://github.com/openstack/python-cratonclient/blob/master/cratonclient/shell/v1/hosts_shell.py#L14919:36
thomasemHuh19:37
anonymikethats an error on fresh build19:37
thomasemhttps://github.com/openstack/python-cratonclient/blob/master/cratonclient/shell/v1/regions_shell.py#L11619:37
thomasemhttps://github.com/openstack/craton/blob/master/craton/api/v1/schemas.py#L95719:37
*** harlowja has quit IRC19:37
thomasemyeah because it's expecting "details", like you set.19:37
thomasemBut, it should be returning with vars: https://github.com/openstack/craton/blob/master/craton/api/v1/resources/inventory/hosts.py#L2319:39
thomasemhmmmm19:39
anonymikeyep, and even after that it's returning the variable manager19:39
anonymikeive traced it in the client19:39
thomasemDo you get the variables when you hit the API without the client?19:40
thomasemand set details=all?19:40
thomasemor 'true' or whatever19:40
anonymikeyes19:40
anonymikehttps://github.com/openstack/python-cratonclient/blob/master/cratonclient/crud.py#L12119:40
anonymikei have all the variables until then19:40
anonymikethen it does the resource class hides em19:40
thomasemCan you try hosts.to_dict()['variables'] and see what's there?19:41
anonymikeon the generator?19:42
thomasemanonymike: Sorry, that's right, it's a generator. Then host.to_dict()['variables'] for each item from the generator.19:43
thomasem[host.to_dict()['variables'] for host in hosts]19:43
thomasemAnd see what's there.19:43
anonymikeright, just ran that and it looks like i have all the variables when I do that but its the object otherwise19:43
anonymikejust a moment let me check again19:44
thomasemSo, this is a problem with the way a resource model is abstractly constructed from the API response and overlayed on a Python class.19:44
thomasemBut, when we went to add Variable management via the CLI, we needed to have some way to access the variables to put/delete on the variables for a resource.19:45
thomasemSo, resource.variables is a VariableManager instead of the resp.json()['variables'] from the API response for that resource.19:45
anonymikeSo I think I can easily fix this by converting to dict in the table formatter19:45
anonymikewould that be okay?19:45
thomasemTherefore, I would recommend using resource.to_dict()19:45
anonymikeit already works in json formatting19:45
thomaseminstead of resource.<attribute>19:45
anonymikecool19:45
thomasemjimbaker: thoughts ^^?19:46
thomasemYeah.. it's not ideal19:46
thomasemBut, those were the limitations of the implemented pattern, I'm afraid.19:46
thomasemI suppose we could have gone with something like resource.variable_mgr.[update, delete]19:46
anonymikealso... why did the tests miss the error for calling details? :/19:46
thomasemTests need some shoring up on that front.19:47
jimbakertests are never perfect19:47
jimbakeranyway, the approach sounds good to me - we want to work with the api as it is, not revisit. that took a bit of work19:48
thomasemanonymike: so, yeah, seems alright to use resource.to_dict() instead.19:48
anonymikecool19:48
thomasemSorry for the pain there. I know it's not ideal. :(19:48
anonymikewew that threw me for quite the loop tracing it back lol19:48
thomasemI can imagine.19:48
thomasemthanks jimbaker!19:49
anonymikehelped me understand the flow a lot though so good exercise19:49
anonymikeyeah thanks guys19:49
thomasemGood positive spin there. :P19:49
thomasemAgreed19:49
jimbaker:)19:49
*** harlowja has joined #craton20:53
*** VW_ has joined #craton22:29
*** VW has quit IRC22:32
*** VW_ has quit IRC22:33

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