Skip to content

Commit 6d35bf7

Browse files
authored
Merge pull request #154 from fabianvf/release-0.4
Backport #153 and bump version
2 parents 2be7526 + 8638934 commit 6d35bf7

File tree

6 files changed

+13
-8
lines changed

6 files changed

+13
-8
lines changed

openshift/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ OpenShift provides builds, application lifecycle, image content management, and
44
This Python package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
55

66
- API version: latest
7-
- Package version: 0.4.1
7+
- Package version: 0.4.2
88
- Build package: io.swagger.codegen.languages.PythonClientCodegen
99

1010
## Requirements.

openshift/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@
1818

1919
# Do not edit these constants. They will be updated automatically
2020
# by scripts/update-client.sh.
21-
__version__ = "0.4.1"
21+
__version__ = "0.4.2"
2222
__k8s_client_version__ = "4.0.0"

openshift/helper/base.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -411,9 +411,10 @@ def properties_from_model_class(cls, model_class):
411411
return result
412412

413413
def candidate_apis(self):
414+
api_match = self.api_version.replace('/', '_').lower()
414415
return [
415416
api for api in self.available_apis()
416-
if self.api_version in self.attribute_to_snake(api)
417+
if api_match in self.attribute_to_snake(api)
417418
or not VERSION_RX.match(api)
418419
]
419420

@@ -433,7 +434,6 @@ def lookup_method(self, operation=None, namespace=None, method_name=None):
433434
method = None
434435
for api in self.candidate_apis():
435436
api_class = self.api_class_from_name(api)
436-
437437
method = getattr(api_class(self.api_client), method_name, None)
438438
if method is not None:
439439
break
@@ -487,8 +487,13 @@ def get_model(self, api_version, kind):
487487
:param kind: The name of object type (i.e. Service, Route, Container, etc.)
488488
:return: class
489489
"""
490+
491+
# Handle API paths. In the case of 'batch/', remove it completely, otherwise, replace '/' with '_'.
492+
api = re.sub(r'batch/', '', api_version, count=0, flags=re.IGNORECASE).replace('/', '_')
493+
490494
camel_kind = string_utils.snake_case_to_camel(kind)
491-
camel_api_version = string_utils.snake_case_to_camel(api_version)
495+
camel_api_version = string_utils.snake_case_to_camel(api)
496+
492497
# capitalize the first letter of the string without lower-casing the remainder
493498
name = (camel_kind[:1].capitalize() + camel_kind[1:]).replace("Api", "API")
494499
api = camel_api_version[:1].capitalize() + camel_api_version[1:]

python-openshift.spec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
%global library openshift
44

55
Name: python-%{library}
6-
Version: 0.4.1
6+
Version: 0.4.2
77
Release: 6%{?dist}
88
Summary: Python client for the OpenShift API
99
License: MIT

scripts/constants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
# client version for packaging and releasing. It can
2525
# be different than SPEC_VERSION.
26-
CLIENT_VERSION = "0.4.1"
26+
CLIENT_VERSION = "0.4.2"
2727
KUBERNETES_CLIENT_VERSION = "4.0.0"
2828

2929
# Name of the release package

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

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

0 commit comments

Comments
 (0)