Merge "Fixed kwargs being defaulted to CONF values"

This commit is contained in:
Jenkins 2016-04-18 20:43:23 +00:00 committed by Gerrit Code Review
commit 2844e32811
4 changed files with 9 additions and 6 deletions

View File

@ -138,7 +138,8 @@ class TroveBaseTraits(object):
self.context = ctxt
return self
def notify(self, event_type, publisher_id=CONF.host):
def notify(self, event_type, publisher_id=None):
publisher_id = publisher_id or CONF.host
event_type = self.event_type_format % event_type
event_payload = self.serialize(self.context)
LOG.debug('Sending event: %(event_type)s, %(payload)s' %

View File

@ -40,8 +40,7 @@ def normalize_url(url):
def get_endpoint(service_catalog, service_type=None,
endpoint_region=CONF.os_region_name,
endpoint_type='publicURL'):
endpoint_region=None, endpoint_type='publicURL'):
"""
Select an endpoint from the service catalog
@ -53,6 +52,8 @@ def get_endpoint(service_catalog, service_type=None,
Some parts copied from glance/common/auth.py.
"""
endpoint_region = endpoint_region or CONF.os_region_name
if not service_catalog:
raise exception.EmptyCatalog()

View File

@ -280,7 +280,8 @@ def correct_id_with_req(id, request):
return id
def generate_random_password(password_length=CONF.default_password_length):
def generate_random_password(password_length=None):
password_length = password_length or CONF.default_password_length
return passlib_utils.generate_password(size=password_length)

View File

@ -473,9 +473,9 @@ class RedisAdmin(object):
_("Redis command '%(cmd_name)s %(cmd_args)s' failed.")
% {'cmd_name': cmd_name, 'cmd_args': ' '.join(cmd_args)})
def wait_until(self, key, wait_value, section=None,
timeout=CONF.usage_timeout):
def wait_until(self, key, wait_value, section=None, timeout=None):
"""Polls redis until the specified 'key' changes to 'wait_value'."""
timeout = timeout or CONF.usage_timeout
LOG.debug("Waiting for Redis '%s' to be: %s." % (key, wait_value))
def _check_info():