[openstack-dev] [Oslo][Designate][Congress] Problem with from_dict overrides and new oslo.context release

Graham Hayes gr at ham.ie
Tue Oct 10 12:14:00 UTC 2017



On 09/10/17 18:03, Ben Nemec wrote:
> Hi,
> 
> I brought up the fix[1] I proposed for [2] in the Oslo meeting today,
> and it led to some good discussion that we wanted to take to a broader
> audience.  In particular, the projects that are affected by the bug.
> 
> The oslo.context change I proposed would essentially obsolete the
> from_dict function in the Context object since it would obligate us to
> support all the keys in to_dict in the constructor.  This unfortunately
> implies some rather rigid constraints on the Context object.  We could
> essentially never remove any parameters from the constructor (which at
> some point we want to do for things like "tenant" that are deprecated
> but still present) or risk breaking if someone passed in parameters from
> an old to_dict call.
> 
> The other proposal was to rewrite the existing naive from_dict overrides
> in the affected projects to function more like the from_dict in the base
> class where it explicitly handles only the keys that the constructor
> will recognize.[3]  One benefit of this approach is that it would allow
> the removal of some previous workarounds[4].  This is also cleaner from
> an API perspective as it doesn't impose any new requirements on the
> oslo.context API.  The obvious drawback is that it requires
> project-specific fixes in the affected projects.  We would, of course,
> be happy to help with those fixes though.
> 
> So those are the options we've discussed and my thoughts on them. Please
> feel free to weigh in with any other input you may have.  Thanks.
> 
> -Ben
> 
> 1: https://review.openstack.org/509919
> 2: https://launchpad.net/bugs/1721432
> 3:
> https://github.com/openstack/oslo.context/blob/master/oslo_context/context.py#L371
> 
> 4:
> https://github.com/openstack/designate/blob/46de766e513cfb97cbfc50b001734e02711517e4/designate/context.py#L42
> 
> 

I am happy to do whatever work is needed on the Designate side for a
good generic solution. We keep running into issues with our custom
`from_dict` so anything I can do to help avoid it would be great.

I put up a change to block 2.19.1 until we can pass the gate [1] with
the new solution

- Graham

1 - https://review.openstack.org/510857

> __________________________________________________________________________
> OpenStack Development Mailing List (not for usage questions)
> Unsubscribe: OpenStack-dev-request at lists.openstack.org?subject:unsubscribe
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0x23BA8E2E.asc
Type: application/pgp-keys
Size: 27355 bytes
Desc: not available
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20171010/f4621c2b/attachment.key>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 455 bytes
Desc: OpenPGP digital signature
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20171010/f4621c2b/attachment.sig>


More information about the OpenStack-dev mailing list