Skip to content

Commit

Permalink
Convert port to string. (#919)
Browse files Browse the repository at this point in the history
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 <[email protected]>
Co-committed-by: Thomas E Lackey <[email protected]>
  • Loading branch information
telackey authored and Thomas E Lackey committed Aug 14, 2024
1 parent 65c1cdf commit 8576137
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions stack_orchestrator/deploy/k8s/cluster_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,10 @@ def get_nodeports(self):
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}")
Expand Down

0 comments on commit 8576137

Please sign in to comment.