commit e75f4c5ad91962e272d65daa770e00f70f931ecb
Author: Ben Nemec <email address hidden>
Date: Tue Oct 10 20:40:34 2017 +0000
Make from_dict extensible
Some of our consumers define additional members on the context class
that they want included in to_dict and from_dict. While it is
possible to do this today via overrides of those functions, the
from_dict implementation in particular is a little non-obvious.
This has led to bugs when the base class's to_dict behavior changes.
This change moves the logic around extending the keys recognized by
from_dict into from_dict itself and allows consumers to simply
provide a list of those keys by overriding a class member.
Reviewed: https:/ /review. openstack. org/511026 /git.openstack. org/cgit/ openstack/ oslo.context/ commit/ ?id=e75f4c5ad91 962e272d65daa77 0e00f70f931ecb
Committed: https:/
Submitter: Zuul
Branch: master
commit e75f4c5ad91962e 272d65daa770e00 f70f931ecb
Author: Ben Nemec <email address hidden>
Date: Tue Oct 10 20:40:34 2017 +0000
Make from_dict extensible
Some of our consumers define additional members on the context class
that they want included in to_dict and from_dict. While it is
possible to do this today via overrides of those functions, the
from_dict implementation in particular is a little non-obvious.
This has led to bugs when the base class's to_dict behavior changes.
This change moves the logic around extending the keys recognized by
from_dict into from_dict itself and allows consumers to simply
provide a list of those keys by overriding a class member.
Change-Id: Ib143f8a5c129db f6711800c4d87c8 830a8aa3365
Related-Bug: 1721432