mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-07-29 07:14:20 +00:00
Fix TypeError when CONDA_PREFIX is not set
I ran a build with the mode set to `conda` by accident and did not have the `CONDA_PREFIX` env var set. In that case, `os.getenv` returns `None`, and passing `None` to create an `os.Path` is not valid. It will raise a `TypeError`. > TypeError: expected str, bytes or os.PathLike object, not NoneType Signed-off-by: Russell Bryant <rbryant@redhat.com>
This commit is contained in:
parent
6236634d84
commit
31e235490c
2 changed files with 2 additions and 2 deletions
|
@ -101,7 +101,7 @@ class StackBuild(Subcommand):
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
build_dir = (
|
build_dir = (
|
||||||
Path(os.getenv("CONDA_PREFIX")).parent
|
Path(os.getenv("CONDA_PREFIX", "")).parent
|
||||||
/ f"llamastack-{build_config.name}"
|
/ f"llamastack-{build_config.name}"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -67,7 +67,7 @@ class StackConfigure(Subcommand):
|
||||||
)
|
)
|
||||||
if os.getenv("CONDA_PREFIX"):
|
if os.getenv("CONDA_PREFIX"):
|
||||||
conda_dir = (
|
conda_dir = (
|
||||||
Path(os.getenv("CONDA_PREFIX")).parent / f"llamastack-{args.config}"
|
Path(os.getenv("CONDA_PREFIX", "")).parent / f"llamastack-{args.config}"
|
||||||
)
|
)
|
||||||
build_config_file = Path(conda_dir) / f"{args.config}-build.yaml"
|
build_config_file = Path(conda_dir) / f"{args.config}-build.yaml"
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue