Skip to content

Commit

Permalink
Type cleanup for MyPy
Browse files Browse the repository at this point in the history
  • Loading branch information
LCVcode committed Feb 7, 2025
1 parent 5f8d74b commit 6e83eae
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/jockey/cloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from orjson import loads as json_loads
from paramiko.ssh_exception import PasswordRequiredException

from jockey.cache import FileCache, Reference
# from jockey.cache import FileCache, Reference
from jockey.juju_schema.full_status import FullStatus


Expand Down
6 changes: 3 additions & 3 deletions src/jockey/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -909,7 +909,7 @@ def filter_machines(status: JujuStatus, filters: List[JockeyFilter]) -> Generato
}


def get_juju_status(file: str = "", model_name: str = "", cache_age: float = 300) -> JujuStatus:
def get_juju_status(file: str = "", model_name: str = "", cache_age: int = 300) -> JujuStatus:
"""
Loads a Juju status from a file, a Jockey cache, or the juju CLI.
Providing a file ignores all caching.
Expand All @@ -924,7 +924,7 @@ def get_juju_status(file: str = "", model_name: str = "", cache_age: float = 300
A local file to read from.
model_name (str) [optional]
The name of a Juju model.
cache_age (float) [optional]
cache_age (int) [optional]
The maximum allowable age of a Jockey cache.
"""
# Prefer loading from a file, when provided
Expand All @@ -935,7 +935,7 @@ def get_juju_status(file: str = "", model_name: str = "", cache_age: float = 300
return json.loads(f.read())

# Get model name and build a CacheContext
model_name = model_name or os.environ.get("JUJU_MODEL", None)
model_name = model_name or os.environ.get("JUJU_MODEL", "")
assert model_name, "You must provide a Juju model name or have the `JUJU_MODEL` environment variable set."
cache_context = new_cache_context(model=model_name, max_age=cache_age)

Expand Down

0 comments on commit 6e83eae

Please sign in to comment.