Earlier  
Posted Nick Remark
#openstack-sdks - 2017-11-13
13:39:25 mordred kuzko: for now the best bet would just be to make another cloud object but overriding the project_name in kwargs ... there's an example in the functional tests of doing that - one sec ...
13:40:57 kuzko oh good day sir mordred ! thank you for the workaround, the onjly thing that came to my mind would have to create a temporary cloud.yml change the tenant it wazs supposed to point to and create a new openstack_cloud with it... if yyou tell me there is a pure python of doing it i'll teka it ^^
13:40:59 kuzko *take
13:42:33 mordred kuzko: yah - so you can actually overlay values ...
13:42:43 mordred kuzko: https://github.com/openstack-infra/shade/blob/master/shade/tests/functional/test_users.py#L135 is the example I was thinking of
13:42:46 kuzko how so?
13:43:30 mordred kuzko: so you can just say openstack_cloud(cloud='cloud-name', project_name='new-project') and it'll give you a cloud basd on cloud-name but with project_name set to a different project
13:43:53 mordred or - at least, you should be able to
13:44:04 kuzko oh it's that simple? let me try that right away
13:46:46 openstackgerrit chenyb4 proposed openstack/python-openstacksdk master: Add cluster support force delete parameter when cluster/node delete https://review.openstack.org/518874
13:47:06 kuzko nope, doing so sends a MissingRequiredOptions auth plugin requires parameters which were not given : auth_url
13:47:45 kuzko mordred : maybe I should specifiy every parameter of the cloud endpoint?
13:49:50 kuzko nope even with that it doesn't return the proper values...
13:49:54 mordred hrm.
13:50:06 mordred gimme a sec ... lemme poke real quick
13:52:11 mordred kuzko: http://paste.openstack.org/show/626160/ <-- this works for me
13:52:36 mordred (I commented project_name out of the clouds.yaml entry for vexxhost)
13:56:06 kuzko I replied to your paste
13:57:51 kuzko it's using keystone V2.0 api endpoint if it means anythings
13:58:34 mordred hrm
13:58:55 kuzko http://paste.openstack.org/show/626161/
13:59:33 mordred ok. it's not overriding the setting. one sec ...
14:00:49 mordred aha - duh. it's in the auth dict ... try wrapping it in an auth=dict( ...
14:00:50 mordred cloud = shade.openstack_cloud(cloud='vexxhost', auth=dict(project_name=project_name))
14:02:53 kuzko no, it's still giving me the empty list treatment
14:04:27 kuzko and if I don't specify the auth_url, username and password in the dict() it fails
14:04:28 kuzko cloud2=openstack_cloud(cloud2="cloudwatt_fr1", auth=dict(project_name=tenant["name"]))
14:04:36 kuzko gives keystoneauth1.exceptions.auth_plugins.MissingRequiredOptions: Auth plugin requires parameters which were not given: auth_url
14:05:27 mordred oh - I see it
14:05:39 mordred cloud2=openstack_cloud(cloud2="cloudwatt_fr1", auth=dict(project_name=tenant["name"])) needs to be cloud2=openstack_cloud(cloud="cloudwatt_fr1", auth=dict(project_name=tenant["name"]))
14:07:10 kuzko y am I dumb?
14:07:34 kuzko it works, thank you very much
14:17:56 mordred \o/
14:18:12 mordred I'll hopefully get a better answer for that soon - it comes up in a bunch of contexts
14:42:29 Shrews mordred: mmm, that tenant context manager would be nifty
14:53:57 mordred Shrews: I think I've almost got it written now (got nerdsniped)
14:54:38 mordred Shrews, briancurtin, dtroyer, SamYaple: email overview of the outstanding patches send to dev list with subject: "[python-openstacksdk][shade] Reviewing the merge-shade patches"
14:57:04 Shrews mordred: oh, so shade as a repo would be no more? that's news to me
14:57:16 Shrews but i guess it makes sense
14:59:21 Shrews mordred: what about the ansible tests? quick scan of that email doesn't show a reference
15:01:21 Shrews actually, i'll reply to that email
15:19:07 mordred Shrews: well - shade as a repo will stick around - but it'll become a very thin layer that wraps the shade code in openstacksdk
15:20:00 mordred Shrews: because we have an opportunity to fix some of the defaults with moving the code to the sdk tree - but we need to keep backwards compat for shade users ...
15:21:25 mordred Shrews: so, taking extra_specs as an example (turns out our default behavior of always fetching was stupid) ... we can turn that off by default in the sdk code, but have list_flavors in shade be def list_flavors(self, fetch_extra_specs=True): sdk.list_flavors(fetch_extra_specs=fetch_extra_specs) ...
15:22:21 mordred Shrews: I should probably write down thinking about that too shouldn't I?
15:22:58 mordred Shrews: btw - same thing with OCC ... opportunity to clean up the code in the sdk tree - as long as we can keep a compat shim for folks using it directly via occ itself
15:24:05 openstackgerrit Hongbin Lu proposed openstack/python-openstackclient master: Replace %r with %s on printing string variable https://review.openstack.org/519385
15:36:58 kuzko hum, I'm back on the same thing but with a new case... how can I deal with v3 domains???
15:38:36 kuzko running a cloud.list_projects() returns a 401 , so I'm looking to return the domains and search in them for servers, but I don't really see how... cloud.list_domains() doesn't seem to be a thing
15:41:24 openstackgerrit Monty Taylor proposed openstack-infra/shade master: Add ability to work in other auth contexts https://review.openstack.org/519394
15:41:35 mordred kuzko: ^^ maybe that will actually give you the tools you need
15:42:35 mordred kuzko: also - list_domains IS a thing, but it's in the OperatorCloud object, so instead of shade.openstack_cloud() you need to use shade.operator_cloud() ... and thanks, that points out a bug in the patch above
15:43:53 Shrews mordred: k, I get it now. Thx
15:43:54 openstackgerrit Monty Taylor proposed openstack-infra/shade master: Add ability to work in other auth contexts https://review.openstack.org/519394
15:47:31 mordred kuzko, Shrews: ^^ ... if that looks good to folks, I'll add some tests for it ... I tested it locally with http://paste.openstack.org/show/626175/ ... although I just added one more line to that test and found a place it's unhappy
15:54:06 kuzko hummmm... I didn't expect to raise a patch ... so I'm kinda stuck because the public cloud I use seems to lock access to operator_cloud() stuff (quite understandable) so ... hmmmmm
15:54:58 mordred kuzko: well - the patch I've got above should handle the domain stuff without needing operator cloud or list_domains ...
15:55:51 mordred kuzko: if the projects are in different domains, then list_projects should return domain-id in the project payload - and connect_as_project / as_project should properly pull that from the project dict returned from list_projects
15:57:10 mordred kuzko: you can TOTALLY copy-pasta code from those methods in to your program - but we can also likely get a new shade release cut with those methods within the day if they work for you
15:57:32 mordred speaking of - I should really get a cloudwatt acount ...
15:57:52 kuzko oh right, i'll try to copy paste my way out of this...
15:58:47 kuzko and I don't really suggest this, they are quite terrible... for them, an horizon console unavailable is not considered downtime if the API's endpoints on one of the two regions are available...
16:03:02 mordred kuzko: well - that may be - but I like to have accounts on all the public clouds so that I can do testing against them from time to time
16:03:29 mordred kuzko: it wasn't an issue this time, but sometimes if you have an issue on cloudwatt and I try to reproduce it on citycloud I can't ...
16:03:42 openstackgerrit Monty Taylor proposed openstack-infra/shade master: Add ability to work in other auth contexts https://review.openstack.org/519394
16:03:45 mordred this time with tests
16:04:58 mordred kuzko: if you copy/paste those methods into your program, just replace the self parameter with a parameter that you can pass a cloud object too and they should otherwise work - you'll need to add imports for keystoneauth1.session, copy and contextlib
16:05:03 mordred Shrews: ^^ added tests
16:06:14 kuzko well, I modified openstackcloud.py, and now I'll try to find a way to change that self stuff you mentionned
16:10:40 GreenBlood mordred: kuzko and I, at the office, are always amazed by your work on shade and the speed at which you program stuff
16:18:10 kuzko mordred by any means, do you have an account on opentelekom cloud?
16:31:16 mordred kuzko: I do not - I had one for a little bit but I don't think it works any more - I keep meaning to follow up on that
16:32:04 mordred GreenBlood: thanks - well, it's usually because there is something that's been on the TODO list for a while and someone just gives an excuse to do it - it makes it look like I'm thinking faster than I actually am :)
16:33:01 kuzko well, I was asking because telefonica's public cloud, t-system open public cloud and oranges cloud for business are the same backend, so verifying on one of these is pretty much validating the 3 of them...
16:33:39 mordred ah - neat
16:34:08 mordred cloudwatt moved to using the huawei openstack stuff? I didn't realize that
16:35:41 briancurtin mordred: i’ll look around for that mailing list thread and try to prioritize a few of them. i normally do some open source stuff in the morning before start The Real Job, so i’ll try to get a few of them looked at this week
16:37:14 mordred briancurtin: woot. the big ugly patch (https://review.openstack.org/#/c/519029/) or its non-squashed equiv (https://review.openstack.org/#/c/501428 through https://review.openstack.org/#/c/519024) is the thing I think your eyes and background are the most essential for - a bunch of the others are just mechanical
16:38:25 mordred briancurtin: but the stuff that mucks around with Connection and turns the Proxy objects in to subclasses of keystoneauth Adapter are things where you're going to know WAY more about edge cases and gotchas
16:39:24 mordred (that's likely apparent from the email (I hope) - but since you're doing off-hours open source I figure I should try to point out things where your brain is more specifically important)
16:45:55 kuzko mordred : nope cloudwatt and orange cloud for business public cloud based on huawei and cuccurent offers from the same brand...
16:46:12 mordred briancurtin: also - while I'm bugging you - is there an overview doc anywhere describing what's needed to migrate something from Resource/Proxy to Resource2/Proxy2?
16:46:17 kuzko french people, don't try to make sense out of it... cloudwatt is still going vanilla openstack
16:46:53 briancurtin mordred: there’s nothing documented, but i can write something up for that
16:47:37 kuzko s/and cuccurent/are competing
16:48:20 mordred kuzko: awesome. good to know :)
16:48:33 mordred briancurtin: cool, thanks! I started just trying to infer what was needed by looking at previous patches that had done migrations, but I figured there's probably a saner-way to work on that
17:34:57 openstackgerrit Monty Taylor proposed openstack-infra/shade master: Add ability to work in other auth contexts https://review.openstack.org/519394
17:47:41 SamYaple mordred: yep will get on the reviews today now that all the traveling isdone
17:49:21 mordred SamYaple: were you in Sydney and I just didn't see you?
17:49:58 SamYaple nah ihad to be in california for other business
17:56:43 mordred ah. ok.
19:35:38 openstackgerrit Monty Taylor proposed openstack-infra/shade master: Add ability to work in other auth contexts https://review.openstack.org/519394
20:56:32 briancurtin mordred: the resource/resource2 move is, as you noticed, mostly easily picked up just by looking at other changes, but i can’t really think of anything special outside of what i just wrote here: https://etherpad.openstack.org/p/sdk-resource-transition
20:58:00 briancurtin most of that work is done, but just a matter of picking up a few remaining ones and making sure they work. i had always wanted to get around to getting object_store done, but i think that’s probably the biggest gap right now
21:09:43 openstackgerrit OpenStack Proposal Bot proposed openstack/keystoneauth master: Updated from global requirements https://review.openstack.org/519107
21:09:53 openstackgerrit OpenStack Proposal Bot proposed openstack/keystoneauth master: Updated from global requirements https://review.openstack.org/519107
21:10:14 openstackgerrit OpenStack Proposal Bot proposed openstack/keystoneauth master: Updated from global requirements https://review.openstack.org/519107
21:11:49 openstackgerrit OpenStack Proposal Bot proposed openstack/keystoneauth master: Updated from global requirements https://review.openstack.org/519107
21:15:24 openstackgerrit OpenStack Proposal Bot proposed openstack/keystoneauth master: Updated from global requirements https://review.openstack.org/519107

Earlier   Later