Avoid `None` as a redundant argument to dict.get()

`dict.get()` returns `None` by default, if a key wasn't found.
Removing `None` as second argument to avoid redundancy.

Change-Id: I810854f50257b9dc805248ff1017521cc82d5d73
changes/19/280319/1
Raildo Mascena 7 years ago
parent 406fbfaa26
commit d32d9de2aa
  1. 2
      keystone/revoke/model.py
  2. 2
      keystone/tests/unit/core.py
  3. 2
      keystone/tests/unit/fakeldap.py

@ -73,7 +73,7 @@ def blank_token_data(issued_at):
class RevokeEvent(object):
def __init__(self, **kwargs):
for k in REVOKE_KEYS:
v = kwargs.get(k, None)
v = kwargs.get(k)
setattr(self, k, v)
if self.domain_id and self.expires_at:

@ -275,7 +275,7 @@ def new_endpoint_ref(service_id, interface='public',
if region_id is NEEDS_REGION_ID:
ref['region_id'] = uuid.uuid4().hex
elif region_id is None and kwargs.get('region', None) is not None:
elif region_id is None and kwargs.get('region') is not None:
# pre-3.2 form endpoints are not supported by this function
raise NotImplementedError("use new_endpoint_ref_with_region")
else:

@ -535,7 +535,7 @@ class FakeLdap(core.LDAPHandler):
self._ldap_options[option] = invalue
def get_option(self, option):
value = self._ldap_options.get(option, None)
value = self._ldap_options.get(option)
return value
def search_ext(self, base, scope,

Loading…
Cancel
Save