Skip to content

Commit 6a481c5

Browse files
committed
Merge branch 'master' of github.com:openshift/openshift-restclient-python
2 parents 85f3fda + 4946d58 commit 6a481c5

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

openshift/dynamic/client.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,10 @@ def get_resources_for_api_version(self, prefix, group, version, preferred):
121121
subresources[resource][name] = subresource
122122

123123
for resource in resources_raw:
124+
# Prevent duplicate keys
125+
for key in ('prefix', 'group', 'api_version', 'client', 'preferred'):
126+
resource.pop(key, None)
127+
124128
resources[resource['kind']] = Resource(
125129
prefix=prefix,
126130
group=group,
@@ -186,9 +190,9 @@ def patch(self, resource, body=None, name=None, namespace=None, **kwargs):
186190
namespace = self.ensure_namespace(resource, namespace, body)
187191

188192
content_type = kwargs.pop('content_type', 'application/strategic-merge-patch+json')
189-
path = resource.path(name=name, namespace=namespace, **kwargs)
193+
path = resource.path(name=name, namespace=namespace)
190194

191-
return self.request('patch', path, body=body, content_type=content_type)
195+
return self.request('patch', path, body=body, content_type=content_type, **kwargs)
192196

193197

194198
def request(self, method, path, body=None, **params):

0 commit comments

Comments
 (0)