From 8576137557e264f49880db50c92de9bded8d280d Mon Sep 17 00:00:00 2001 From: Thomas E Lackey Date: Wed, 14 Aug 2024 00:25:35 +0000 Subject: [PATCH] Convert port to string. (#919) The str type check doesn't work if the port is a ruamel.yaml.scalarstring.SingleQuotedScalarString or ruamel.yaml.scalarstring.DoubleQuotedScalarString Reviewed-on: https://git.vdb.to/cerc-io/stack-orchestrator/pulls/919 Co-authored-by: Thomas E Lackey Co-committed-by: Thomas E Lackey --- stack_orchestrator/deploy/k8s/cluster_info.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stack_orchestrator/deploy/k8s/cluster_info.py b/stack_orchestrator/deploy/k8s/cluster_info.py index fe953325..35c06e42 100644 --- a/stack_orchestrator/deploy/k8s/cluster_info.py +++ b/stack_orchestrator/deploy/k8s/cluster_info.py @@ -86,10 +86,10 @@ class ClusterInfo: for service_name in services: service_info = services[service_name] if "ports" in service_info: - for raw_port in service_info["ports"]: + for raw_port in [str(p) for p in service_info["ports"]]: if opts.o.debug: print(f"service port: {raw_port}") - if type(raw_port) is str and ":" in raw_port: + if ":" in raw_port: parts = raw_port.split(":") if len(parts) != 2: raise Exception(f"Invalid port definition: {raw_port}")