Skip to content

Commit

Permalink
Rename parameter async into async_req to support Python 3.7
Browse files Browse the repository at this point in the history
as Python 3.7 treats async as a reserved keyword.
  • Loading branch information
roycaihw committed Jul 11, 2018
1 parent 9b438ee commit b10c7b6
Show file tree
Hide file tree
Showing 55 changed files with 7,131 additions and 7,131 deletions.
6 changes: 3 additions & 3 deletions kubernetes/client/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ def __deserialize(self, data, klass):
def call_api(self, resource_path, method,
path_params=None, query_params=None, header_params=None,
body=None, post_params=None, files=None,
response_type=None, auth_settings=None, async=None,
response_type=None, auth_settings=None, async_req=None,
_return_http_data_only=None, collection_formats=None, _preload_content=True,
_request_timeout=None):
"""
Expand All @@ -298,7 +298,7 @@ def call_api(self, resource_path, method,
:param response: Response data type.
:param files dict: key -> filename, value -> filepath,
for `multipart/form-data`.
:param async bool: execute request asynchronously
:param async_req bool: execute request asynchronously
:param _return_http_data_only: response data without head status code and headers
:param collection_formats: dict of collection formats for path, query,
header, and post parameters.
Expand All @@ -313,7 +313,7 @@ def call_api(self, resource_path, method,
If parameter async is False or missing,
then the method will return the response directly.
"""
if not async:
if not async_req:
return self.__call_api(resource_path, method,
path_params, query_params, header_params,
body, post_params, files,
Expand Down
18 changes: 9 additions & 9 deletions kubernetes/client/apis/admissionregistration_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,17 @@ def get_api_group(self, **kwargs):
"""
get information of a group
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_api_group(async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.get_api_group(async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:return: V1APIGroup
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.get_api_group_with_http_info(**kwargs)
else:
(data) = self.get_api_group_with_http_info(**kwargs)
Expand All @@ -59,18 +59,18 @@ def get_api_group_with_http_info(self, **kwargs):
"""
get information of a group
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_api_group_with_http_info(async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.get_api_group_with_http_info(async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:return: V1APIGroup
If the method is called asynchronously,
returns the request thread.
"""

all_params = []
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
Expand Down Expand Up @@ -117,7 +117,7 @@ def get_api_group_with_http_info(self, **kwargs):
files=local_var_files,
response_type='V1APIGroup',
auth_settings=auth_settings,
async=params.get('async'),
async_req=params.get('async_req'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
Expand Down
144 changes: 72 additions & 72 deletions kubernetes/client/apis/admissionregistration_v1alpha1_api.py

Large diffs are not rendered by default.

270 changes: 135 additions & 135 deletions kubernetes/client/apis/admissionregistration_v1beta1_api.py

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions kubernetes/client/apis/apiextensions_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,17 @@ def get_api_group(self, **kwargs):
"""
get information of a group
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_api_group(async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.get_api_group(async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:return: V1APIGroup
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
if kwargs.get('async_req'):
return self.get_api_group_with_http_info(**kwargs)
else:
(data) = self.get_api_group_with_http_info(**kwargs)
Expand All @@ -59,18 +59,18 @@ def get_api_group_with_http_info(self, **kwargs):
"""
get information of a group
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_api_group_with_http_info(async=True)
asynchronous HTTP request, please pass async_req=True
>>> thread = api.get_api_group_with_http_info(async_req=True)
>>> result = thread.get()
:param async bool
:param async_req bool
:return: V1APIGroup
If the method is called asynchronously,
returns the request thread.
"""

all_params = []
all_params.append('async')
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
Expand Down Expand Up @@ -117,7 +117,7 @@ def get_api_group_with_http_info(self, **kwargs):
files=local_var_files,
response_type='V1APIGroup',
auth_settings=auth_settings,
async=params.get('async'),
async_req=params.get('async_req'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
Expand Down
Loading

0 comments on commit b10c7b6

Please sign in to comment.