Remove redundant args of _construct_http_client

Arguments 'extenstions' and 'no_cache' were not transmitted to
'_construct_http_client' method. They are redundant

Change-Id: Ibe0f874e510eef7cc28fcee87b0083c7febd5161
This commit is contained in:
Andrey Kurilin 2016-12-02 19:10:34 +02:00 committed by Andrey Kurilin
parent bf09ad844e
commit 73196fd3c1
4 changed files with 11 additions and 17 deletions

View File

@ -688,11 +688,9 @@ def _construct_http_client(api_version=None,
cacert=None,
connection_pool=False,
endpoint_type='publicURL',
extensions=None,
http_log_debug=False,
insecure=False,
interface=None,
no_cache=True,
os_cache=False,
password=None,
project_id=None,
@ -876,6 +874,11 @@ def Client(version, username=None, api_key=None, project_id=None,
_check_arguments(kwargs, "Ocata", "auth_plugin")
_check_arguments(kwargs, "Ocata", "auth_system")
if "no_cache" in kwargs:
_check_arguments(kwargs, "Ocata", "no_cache", "os_cache")
# os_cache is not a fully compatible with no_cache, so we need to
# apply this custom processing
kwargs["os_cache"] = not kwargs["os_cache"]
api_version, client_class = _get_client_class_and_version(version)
kwargs.pop("direct_use", None)

View File

@ -184,18 +184,6 @@ class ClientTest(utils.TestCase):
self.assertFalse(cs.os_cache)
self.assertFalse(cs.client.os_cache)
def test_client_with_no_cache_enabled(self):
cs = novaclient.client.Client("2", "user", "password", "project_id",
auth_url="foo/v2", no_cache=True)
self.assertFalse(cs.os_cache)
self.assertFalse(cs.client.os_cache)
def test_client_with_no_cache_disabled(self):
cs = novaclient.client.Client("2", "user", "password", "project_id",
auth_url="foo/v2", no_cache=False)
self.assertTrue(cs.os_cache)
self.assertTrue(cs.client.os_cache)
def test_client_set_management_url_v1_1(self):
cs = novaclient.client.Client("2", "user", "password", "project_id",
auth_url="foo/v2")

View File

@ -82,7 +82,6 @@ class Client(object):
http_log_debug=False,
insecure=False,
logger=None,
no_cache=True,
os_cache=False,
project_id=None,
proxy_tenant_id=None,
@ -116,7 +115,6 @@ class Client(object):
:param bool insecure: Allow insecure
:param logging.Logger logger: Logger instance to be used for all
logging stuff
:param bool no_cache: No cache
:param bool os_cache: OS cache
:param str project_id: Project ID
:param str proxy_tenant_id: Tenant ID
@ -191,7 +189,7 @@ class Client(object):
self.services = services.ServiceManager(self)
self.fixed_ips = fixed_ips.FixedIPsManager(self)
self.floating_ips_bulk = floating_ips_bulk.FloatingIPBulkManager(self)
self.os_cache = os_cache or not no_cache
self.os_cache = os_cache
self.availability_zones = \
availability_zones.AvailabilityZoneManager(self)
self.server_groups = server_groups.ServerGroupsManager(self)

View File

@ -0,0 +1,5 @@
---
deprecations:
- novaclient.client.Client entry-point accepted two arguments with same
meaning (**no_cache** and **os_cache**). Since **os_cache** is more widely
used in our code, **no_cache** was deprecated.