Skip to content

Commit

Permalink
static fixes due to ops vbump
Browse files Browse the repository at this point in the history
  • Loading branch information
PietroPasotti committed May 1, 2024
1 parent cbc8b9c commit 9442e6e
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import json
import logging
import socket
from typing import Any, Dict, List, Optional, Tuple, Union
from typing import Any, Dict, List, Optional, Tuple, Union, cast
from urllib.parse import urlparse

import yaml
Expand Down Expand Up @@ -412,7 +412,11 @@ def _get_certs(self) -> Tuple[Optional[str], Optional[str], Optional[str]]:
and self.config.get("tls-cert", None)
and self.config.get("tls-key", None)
):
return self.config["tls-cert"], self.config["tls-key"], self.config["tls-ca"]
return (
cast(str, self.config["tls-cert"]),
cast(str, self.config["tls-key"]),
cast(str, self.config["tls-ca"]),
)
return cert_handler.chain, cert_handler.private_key, cert_handler.ca_cert

def _on_show_proxied_endpoints(self, event: ActionEvent):
Expand Down Expand Up @@ -1058,7 +1062,7 @@ def _external_host(self) -> Optional[str]:
returns None. Only use this directly when external_host is allowed to be None.
"""
if external_hostname := self.model.config.get("external_hostname"):
return external_hostname
return cast(str, external_hostname)

return _get_loadbalancer_status(namespace=self.model.name, service_name=self.app.name)

Expand Down

0 comments on commit 9442e6e

Please sign in to comment.