Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion openshift/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ OpenShift provides builds, application lifecycle, image content management, and
This Python package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:

- API version: latest
- Package version: 0.4.1
- Package version: 0.4.2
- Build package: io.swagger.codegen.languages.PythonClientCodegen

## Requirements.
Expand Down
2 changes: 1 addition & 1 deletion openshift/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@

# Do not edit these constants. They will be updated automatically
# by scripts/update-client.sh.
__version__ = "0.4.1"
__version__ = "0.4.2"
__k8s_client_version__ = "4.0.0"
11 changes: 8 additions & 3 deletions openshift/helper/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,9 +411,10 @@ def properties_from_model_class(cls, model_class):
return result

def candidate_apis(self):
api_match = self.api_version.replace('/', '_').lower()
return [
api for api in self.available_apis()
if self.api_version in self.attribute_to_snake(api)
if api_match in self.attribute_to_snake(api)
or not VERSION_RX.match(api)
]

Expand All @@ -433,7 +434,6 @@ def lookup_method(self, operation=None, namespace=None, method_name=None):
method = None
for api in self.candidate_apis():
api_class = self.api_class_from_name(api)

method = getattr(api_class(self.api_client), method_name, None)
if method is not None:
break
Expand Down Expand Up @@ -487,8 +487,13 @@ def get_model(self, api_version, kind):
:param kind: The name of object type (i.e. Service, Route, Container, etc.)
:return: class
"""

# Handle API paths. In the case of 'batch/', remove it completely, otherwise, replace '/' with '_'.
api = re.sub(r'batch/', '', api_version, count=0, flags=re.IGNORECASE).replace('/', '_')

camel_kind = string_utils.snake_case_to_camel(kind)
camel_api_version = string_utils.snake_case_to_camel(api_version)
camel_api_version = string_utils.snake_case_to_camel(api)

# capitalize the first letter of the string without lower-casing the remainder
name = (camel_kind[:1].capitalize() + camel_kind[1:]).replace("Api", "API")
api = camel_api_version[:1].capitalize() + camel_api_version[1:]
Expand Down
2 changes: 1 addition & 1 deletion python-openshift.spec
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
%global library openshift

Name: python-%{library}
Version: 0.4.1
Version: 0.4.2
Release: 6%{?dist}
Summary: Python client for the OpenShift API
License: MIT
Expand Down
2 changes: 1 addition & 1 deletion scripts/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

# client version for packaging and releasing. It can
# be different than SPEC_VERSION.
CLIENT_VERSION = "0.4.1"
CLIENT_VERSION = "0.4.2"
KUBERNETES_CLIENT_VERSION = "4.0.0"

# Name of the release package
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

# Do not edit these constants. They will be updated automatically
# by scripts/update-client.sh.
CLIENT_VERSION = "0.4.1"
CLIENT_VERSION = "0.4.2"
PACKAGE_NAME = "openshift"
DEVELOPMENT_STATUS = "3 - Alpha"

Expand Down