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:
parent
bf09ad844e
commit
73196fd3c1
@ -688,11 +688,9 @@ def _construct_http_client(api_version=None,
|
|||||||
cacert=None,
|
cacert=None,
|
||||||
connection_pool=False,
|
connection_pool=False,
|
||||||
endpoint_type='publicURL',
|
endpoint_type='publicURL',
|
||||||
extensions=None,
|
|
||||||
http_log_debug=False,
|
http_log_debug=False,
|
||||||
insecure=False,
|
insecure=False,
|
||||||
interface=None,
|
interface=None,
|
||||||
no_cache=True,
|
|
||||||
os_cache=False,
|
os_cache=False,
|
||||||
password=None,
|
password=None,
|
||||||
project_id=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_plugin")
|
||||||
_check_arguments(kwargs, "Ocata", "auth_system")
|
_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)
|
api_version, client_class = _get_client_class_and_version(version)
|
||||||
kwargs.pop("direct_use", None)
|
kwargs.pop("direct_use", None)
|
||||||
|
@ -184,18 +184,6 @@ class ClientTest(utils.TestCase):
|
|||||||
self.assertFalse(cs.os_cache)
|
self.assertFalse(cs.os_cache)
|
||||||
self.assertFalse(cs.client.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):
|
def test_client_set_management_url_v1_1(self):
|
||||||
cs = novaclient.client.Client("2", "user", "password", "project_id",
|
cs = novaclient.client.Client("2", "user", "password", "project_id",
|
||||||
auth_url="foo/v2")
|
auth_url="foo/v2")
|
||||||
|
@ -82,7 +82,6 @@ class Client(object):
|
|||||||
http_log_debug=False,
|
http_log_debug=False,
|
||||||
insecure=False,
|
insecure=False,
|
||||||
logger=None,
|
logger=None,
|
||||||
no_cache=True,
|
|
||||||
os_cache=False,
|
os_cache=False,
|
||||||
project_id=None,
|
project_id=None,
|
||||||
proxy_tenant_id=None,
|
proxy_tenant_id=None,
|
||||||
@ -116,7 +115,6 @@ class Client(object):
|
|||||||
:param bool insecure: Allow insecure
|
:param bool insecure: Allow insecure
|
||||||
:param logging.Logger logger: Logger instance to be used for all
|
:param logging.Logger logger: Logger instance to be used for all
|
||||||
logging stuff
|
logging stuff
|
||||||
:param bool no_cache: No cache
|
|
||||||
:param bool os_cache: OS cache
|
:param bool os_cache: OS cache
|
||||||
:param str project_id: Project ID
|
:param str project_id: Project ID
|
||||||
:param str proxy_tenant_id: Tenant ID
|
:param str proxy_tenant_id: Tenant ID
|
||||||
@ -191,7 +189,7 @@ class Client(object):
|
|||||||
self.services = services.ServiceManager(self)
|
self.services = services.ServiceManager(self)
|
||||||
self.fixed_ips = fixed_ips.FixedIPsManager(self)
|
self.fixed_ips = fixed_ips.FixedIPsManager(self)
|
||||||
self.floating_ips_bulk = floating_ips_bulk.FloatingIPBulkManager(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 = \
|
self.availability_zones = \
|
||||||
availability_zones.AvailabilityZoneManager(self)
|
availability_zones.AvailabilityZoneManager(self)
|
||||||
self.server_groups = server_groups.ServerGroupsManager(self)
|
self.server_groups = server_groups.ServerGroupsManager(self)
|
||||||
|
@ -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.
|
Loading…
x
Reference in New Issue
Block a user