From 3db4f09b56c76569beee175eba5335cf1a58a60d Mon Sep 17 00:00:00 2001 From: Ben Nemec Date: Tue, 10 Oct 2017 20:44:24 +0000 Subject: [PATCH] Use oslo.context from_dict unmodified With the change to oslo.context in the depends-on, we no longer need to maintain an override for the from_dict function. We only need to provide a list of additional keys in the appropriate class member. Depends-On: Ib143f8a5c129dbf6711800c4d87c8830a8aa3365 Change-Id: I922f2e4544de6eb3bddb134ccd87a3bafa5e6c08 --- designate/context.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/designate/context.py b/designate/context.py index 41d62a601..c2819daad 100644 --- a/designate/context.py +++ b/designate/context.py @@ -33,6 +33,10 @@ class DesignateContext(context.RequestContext): original_tenant = None _edit_managed_records = False _client_addr = None + FROM_DICT_EXTRA_KEYS = [ + 'original_tenant', 'service_catalog', 'all_tenants', 'abandon', + 'edit_managed_records', 'tsigkey_id', 'hide_counts', 'client_addr', + ] def __init__(self, service_catalog=None, all_tenants=False, abandon=None, tsigkey_id=None, original_tenant=None, @@ -90,14 +94,6 @@ class DesignateContext(context.RequestContext): return copy.deepcopy(d) - @classmethod - def from_dict(cls, values): - extra_keys = ['original_tenant', 'service_catalog', 'all_tenants', - 'abandon', 'edit_managed_records', 'tsigkey_id', - 'hide_counts', 'client_addr'] - kwargs = {k: values[k] for k in extra_keys} - return super(DesignateContext, cls).from_dict(values, **kwargs) - def elevated(self, show_deleted=None, all_tenants=False, edit_managed_records=False): """Return a version of this context with admin flag set.