openshiftpods: fix delete_namespaced_pod arguments
This change prevents a TypeError when deleting pods: TypeError: delete_namespaced_pod() takes 3 positional arguments but 4 were given Change-Id: I6d31af352e3151eb1bdef52472a4b0b5fa00ecd8
This commit is contained in:
parent
8ee837670e
commit
028a26319e
@ -119,14 +119,8 @@ class OpenshiftPodsProvider(OpenshiftProvider):
|
|||||||
self.log.exception("%s: unknown pool" % server_id)
|
self.log.exception("%s: unknown pool" % server_id)
|
||||||
return
|
return
|
||||||
self.log.debug("%s: removing pod" % pod_name)
|
self.log.debug("%s: removing pod" % pod_name)
|
||||||
delete_body = {
|
|
||||||
"apiVersion": "v1",
|
|
||||||
"kind": "DeleteOptions",
|
|
||||||
"propagationPolicy": "Background"
|
|
||||||
}
|
|
||||||
try:
|
try:
|
||||||
self.k8s_client.delete_namespaced_pod(
|
self.k8s_client.delete_namespaced_pod(pod_name, project_name)
|
||||||
pod_name, project_name, delete_body)
|
|
||||||
self.log.info("%s: pod removed" % server_id)
|
self.log.info("%s: pod removed" % server_id)
|
||||||
except Exception:
|
except Exception:
|
||||||
# TODO: implement better exception handling
|
# TODO: implement better exception handling
|
||||||
|
@ -57,7 +57,7 @@ class FakeCoreClient(object):
|
|||||||
phase = "Running"
|
phase = "Running"
|
||||||
return FakePod
|
return FakePod
|
||||||
|
|
||||||
def delete_namespaced_pod(self, name, project, delete_body):
|
def delete_namespaced_pod(self, name, project):
|
||||||
to_delete = None
|
to_delete = None
|
||||||
for pod in self.pods:
|
for pod in self.pods:
|
||||||
if pod.metadata.name == name:
|
if pod.metadata.name == name:
|
||||||
|
Loading…
Reference in New Issue
Block a user