Earlier  
Posted Nick Remark
#openstack-nova - 2017-10-04
22:23:35 efried jaypipes Like, how does something like ``sa.and_(t.c.id == rpt.c.trait_id, rpt.c.resource_provider_id == rp_id)`` *not* interpret those `==`s in python?
22:26:24 dansmith edleafe: yeah, you need to adjust the return value of that rpc method as well
22:26:39 jaypipes efried: oh, that's actually the beauty of SQLAlchemy's core expression API... it *does* interpret those things actually :) it's just what rpt.c.resource_provider_id == rp_id turns into is an expression object in SQLAlchemy that is processed with the __eq__ magic function...
22:27:05 efried ahhhh, __eq__, of course. Very cool.
22:28:11 efried jaypipes So I guess that means the order of the arguments in there is crucial. (rpt.c.resource_provider_id == rp_id) is cool, but (rp_id == rpt.c.resource_provider_id) is nonsense.
22:28:26 jaypipes efried: no...
22:28:35 dansmith edleafe: that's the next patch though right?
22:28:44 efried Wouldn't it try to use rp_id's __eq__ in that case?
22:29:14 jaypipes efried: there's some magic reflection happening in the sa.and_() function.
22:29:27 jaypipes efried: where it's looking at the structure of the parameters supplied to it.
22:29:58 efried before the interpreter gets hold of it? That *is* magic.
22:30:25 efried jaypipes Because http://paste.openstack.org/show/622705/
22:30:42 dansmith efried: if rp_id is an integer, then yes
22:30:47 dansmith the order would matter
22:31:07 efried dansmith Phew, that makes me feel more sane.
22:32:08 jaypipes efried: there's lots o magic happening in https://github.com/zzzeek/sqlalchemy/blob/master/lib/sqlalchemy/sql/operators.py
22:32:13 jaypipes efried: have fun reading :)
22:32:25 efried This is my first day looking at this sqlalchemy business. Appreciate the pointers.
22:32:57 jaypipes no prob. BTW, zzzeek is the author of SQLAlchemy. I am sure he would be the best person to ask about magicalities in the core expression API. :)
22:37:45 efried I'm pleased to report that nothing in that file blew my freaking mind, or made me expect (int == magic_sqlalchemy_object) not to explode.
22:38:31 mriedem so, dansmith,
22:38:40 mriedem have you and edleafe been up to something you're not telling the rest of us?
22:40:06 dansmith mriedem: um, what?
22:40:16 mriedem https://github.com/jaypipes/articles/commit/1a3dffb5f6fe688874c4f6617d139bf7af8f94c3
22:40:18 dansmith mriedem: the banter was about the alternate hosts patch
22:40:35 dansmith WAT
22:40:53 efried dansmith Oh. On the other hand, it looks like __eq__ may internally handle the left-hand side not understanding the right: http://paste.openstack.org/show/622706/
22:41:09 efried So it probably *would* work.
22:41:34 dansmith efried: I dunno how that works,
22:41:41 dansmith unless it only works against primitives or something
22:41:44 melwitt mriedem: lol
22:42:04 efried I imagine it's like 'except TypeError: try_the_other_guy's___eq___method'
22:42:09 mriedem i enjoy getting to do a pull request once per year
22:43:31 dansmith efried: see the second answer: https://stackoverflow.com/questions/3588776/how-is-eq-handled-in-python-and-in-what-order
22:43:49 edleafe mriedem: dansmith and I were trying to keep that a secret until the Forum!
22:44:41 efried dansmith Beaut, thanks.
22:44:54 dansmith efried: I did not think that worked that way
22:45:01 efried dansmith TIL, for sure.
22:45:20 dansmith and I might be remembering really old behavior, pre-new-style classes and all
22:45:36 efried Makes sense. Very prescient of those who wrote python itself.
22:45:43 edleafe dansmith: well, both patches change what is returned: this adds alternates, and the next changes them all to Selection objects
22:46:01 edleafe Old conductors won't know what to do with alternates
22:46:43 dansmith edleafe: yeah, then you need to pass a flag that says "give me the new stuff", or as mikal would say "do it to me big boy"
22:47:38 dansmith edleafe: I was thinking with all the "make this look like the existing return, change in next patch" stuff that we were remaining compatible here
22:50:04 edleafe dansmith: what's returned from the scheduler manager is the same. These changes are all internal to the scheduler
22:50:23 edleafe the next patch in the series is where all hell breaks loose
22:50:35 dansmith edleafe: okay but not all internal to the scheduler if the rpc api changes
22:50:37 edleafe I hope to have that in a decent state by tomorrow
22:50:57 edleafe the rpc api isn't changing in these
22:52:00 edleafe e.g.: https://review.openstack.org/#/c/486215/13/nova/scheduler/filter_scheduler.py@114
22:55:00 dansmith I'm confused
22:55:41 openstackgerrit OpenStack Proposal Bot proposed openstack/os-vif stable/pike: Updated from global requirements https://review.openstack.org/493146
22:55:45 dansmith edleafe: you said that new conductors will always be passing uuids now.. that is an rpc interface between conductor and scheduler.. we're agreed that you need to keep the test and compat behavior there, yes?
22:56:23 dansmith and the other question is if you're changing the return type of the rpc call that conductor is making..
22:56:49 edleafe dansmith: the instance_uuid change was in Pike
22:57:04 dansmith right
22:57:05 edleafe yeah, I'm keeping the test
22:57:25 dansmith okay, so .. the return value of the rpc call is changed here or no?
22:57:30 edleafe not yet
22:57:43 edleafe I am working on the next patch in the series where is changes
22:57:56 edleafe Needless to say, that breaks a lot of tests
22:58:40 dansmith edleafe: this one right? https://review.openstack.org/#/c/495854/5
22:59:10 dansmith or that one is just internal still and then another one after will change what the rpc consumer gets?
22:59:20 edleafe no, that just changes the scheduler driver's return value to the manager
22:59:36 edleafe the next patch will change what the manager returns, which is the rpc boundary
22:59:41 dansmith right, okay
22:59:56 dansmith so in _that_ one you'll need a flag to say "give me the new stuff"
23:00:14 dansmith and in these before, as long as you keep that test for the empty uuids I think you're good
23:01:17 openstackgerrit Ed Leafe proposed openstack/nova master: Add alternate hosts https://review.openstack.org/486215
23:01:18 openstackgerrit Ed Leafe proposed openstack/nova master: Return Selection objects from the scheduler driver https://review.openstack.org/495854
23:01:18 openstackgerrit Ed Leafe proposed openstack/nova master: Add Selection objects https://review.openstack.org/499239
23:01:22 edleafe dansmith: ^^ fixed per your comments
23:01:37 edleafe only the first patch changed; the rest are rebases
23:03:14 edleafe and with that it's time to make dinner
23:05:33 dansmith edleafe: cool, thanks
23:05:35 dansmith jaypipes: ^
23:08:59 openstackgerrit OpenStack Proposal Bot proposed openstack/os-vif stable/pike: Updated from global requirements https://review.openstack.org/493146
23:20:58 openstackgerrit OpenStack Proposal Bot proposed openstack/os-vif stable/newton: Updated from global requirements https://review.openstack.org/373293
23:37:19 openstackgerrit Merged openstack/nova stable/pike: Add nova-manage db command for ironic flavor migrations https://review.openstack.org/505903
23:40:32 openstackgerrit LIU Yulong proposed openstack/nova-specs master: Reset the instance keypair while rebuilding (spec) https://review.openstack.org/375221
23:51:12 openstackgerrit Merged openstack/nova stable/ocata: Fix --max-count handling for nova-manage cell_v2 map_instances https://review.openstack.org/507556
23:51:47 gmann mriedem: yes, that is kind of dead code. those are not going to be in filter_mapping as API 400 before it
23:54:23 gmann mriedem: we left this while doing schema for index. you have patch up for that cleanup otherwise i can push one.
#openstack-nova - 2017-10-05
00:58:18 openstackgerrit Merged openstack/nova master: Set group_members when converting to legacy request spec https://review.openstack.org/507938
01:45:25 openstackgerrit Takashi NATSUME proposed openstack/python-novaclient master: Microversion 2.54 - List/Show all server migration types https://review.openstack.org/430839
02:09:18 openstackgerrit Merged openstack/nova master: Fix CellDatabases fixture swallowing exceptions https://review.openstack.org/506312
05:40:42 ratailor Can anyone else reproduce this https://bugs.launchpad.net/nova/+bug/1720062
05:40:43 openstack Launchpad bug 1720062 in OpenStack Compute (nova) "Nova unit tests are failing " [Low,Incomplete]
05:55:22 openstackgerrit OpenStack Proposal Bot proposed openstack/os-vif stable/pike: Updated from global requirements https://review.openstack.org/493146
06:13:41 openstackgerrit Hironori Shiina proposed openstack/nova-specs master: Ironic: Resize and cold migration support https://review.openstack.org/449155
06:26:34 openstackgerrit OpenStack Proposal Bot proposed openstack/os-vif stable/pike: Updated from global requirements https://review.openstack.org/493146
06:40:48 openstackgerrit Lajos Katona proposed openstack/nova master: Change live_migrate tests to use fakedriver https://review.openstack.org/505202
07:53:03 openstackgerrit Radoslav Gerganov proposed openstack/nova master: VMware: serial console log (completed) https://review.openstack.org/450636
07:53:03 openstackgerrit Radoslav Gerganov proposed openstack/nova master: Move last_bytes into the path module https://review.openstack.org/509417
08:37:23 openstackgerrit Balazs Gibizer proposed openstack/nova master: Remove dead code of api.fault notification sending https://review.openstack.org/505164
08:42:02 openstackgerrit Rodolfo Alonso Hernandez proposed openstack/nova-specs master: Enable SR-IOV NIC offload feature discovery https://review.openstack.org/504895
09:32:15 openstackgerrit John Garbutt proposed openstack/nova-specs master: Support traits in the Ironic driver https://review.openstack.org/507052
09:35:23 openstackgerrit John Garbutt proposed openstack/nova-specs master: Support traits in the Ironic driver https://review.openstack.org/507052
09:37:41 openstackgerrit John Garbutt proposed openstack/nova-specs master: Support traits in the Ironic driver https://review.openstack.org/507052
09:39:33 openstackgerrit sahid proposed openstack/nova master: libvirt: rework _get_vpcu_total to return online pCPUs https://review.openstack.org/509730

Earlier   Later