Skip to content

Commit

Permalink
Take last element of :-split as port
Browse files Browse the repository at this point in the history
  • Loading branch information
barrettj12 committed Nov 8, 2023
1 parent cc9a173 commit 85946e1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def api_port(self) -> str:
if not isinstance(api_addresses, List):
raise AgentConfException("agent.conf key 'apiaddresses' is not a list")

return api_addresses[0].split(':')[1]
return api_addresses[0].split(':')[-1]

def ca_cert(self) -> str:
"""Return the controller's CA certificate."""
Expand Down

0 comments on commit 85946e1

Please sign in to comment.