Skip to content

Commit 3ff21ba

Browse files
committed
Fixed formatting
1 parent 1309934 commit 3ff21ba

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/codeflare_sdk/cluster/cluster.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,9 @@ def down(self):
151151
)
152152
# Delete the ingress
153153
api_instance = client.NetworkingV1Api(api_config_handler())
154-
api_instance.delete_namespaced_ingress(name=f"ray-dashboard-{self.config.name}", namespace=namespace)
154+
api_instance.delete_namespaced_ingress(
155+
name=f"ray-dashboard-{self.config.name}", namespace=namespace
156+
)
155157
except Exception as e: # pragma: no cover
156158
return _kube_api_error_handling(e)
157159

@@ -266,11 +268,13 @@ def cluster_dashboard_uri(self) -> str:
266268
ingresses = api_instance.list_namespaced_ingress(self.config.namespace)
267269
except Exception as e:
268270
return _kube_api_error_handling(e)
269-
271+
270272
for ingress in ingresses.items:
271273
if (
272274
ingress.metadata.name == f"ray-dashboard-{self.config.name}"
273-
and ingress.spec.rules[0].host.startswith(f"ray-dashboard-{self.config.name}")
275+
and ingress.spec.rules[0].host.startswith(
276+
f"ray-dashboard-{self.config.name}"
277+
)
274278
):
275279
return f"http://{ingress.spec.rules[0].host}"
276280
return "Dashboard route not available yet, have you run cluster.up()?"
@@ -362,6 +366,7 @@ def local_client_url(self):
362366
else:
363367
return "None"
364368

369+
365370
def create_ingress(self):
366371
"""
367372
Create a Kubernetes Ingress resource to expose the Ray dashboard service externally.
@@ -409,6 +414,7 @@ def create_ingress(self):
409414
except Exception as e:
410415
return _kube_api_error_handling(e)
411416

417+
412418
def list_all_clusters(namespace: str, print_to_console: bool = True):
413419
"""
414420
Returns (and prints by default) a list of all clusters in a given namespace.
@@ -590,8 +596,6 @@ def _map_to_ray_cluster(rc) -> Optional[RayCluster]:
590596
for ingress in ingresses.items:
591597
if ingress.metadata.name == f"ray-dashboard-{rc['metadata']['name']}":
592598
ray_route = ingress.spec.rules[0].host
593-
594-
595599

596600
return RayCluster(
597601
name=rc["metadata"]["name"],

0 commit comments

Comments
 (0)