fix: fix llama stack list

llama stack list was still using build.yaml, convert cmd and tests to just use config.yaml

Signed-off-by: Charlie Doern <cdoern@redhat.com>
This commit is contained in:
Charlie Doern 2025-12-01 14:26:35 -05:00
parent 94506126ae
commit b2ab5c2807
2 changed files with 10 additions and 14 deletions

View file

@ -59,19 +59,17 @@ class StackListBuilds(Subcommand):
print("No distributions found")
return
headers = ["Stack Name", "Source", "Path", "Build Config", "Run Config"]
headers = ["Stack Name", "Source", "Path", "Config"]
rows = []
for name, (path, source_type) in sorted(distributions.items()):
row = [name, source_type, str(path)]
# Check for build and run config files
# For built-in distributions, configs are named build.yaml and config.yaml
# For custom distributions, configs are named {name}-build.yaml and {name}-config.yaml
# Check for config files
# For built-in distributions, configs are named config.yaml
# For custom distributions, configs are named {name}-config.yaml
if source_type == "built-in":
build_config = "Yes" if (path / "build.yaml").exists() else "No"
run_config = "Yes" if (path / "config.yaml").exists() else "No"
config = "Yes" if (path / "config.yaml").exists() else "No"
else:
build_config = "Yes" if (path / f"{name}-build.yaml").exists() else "No"
run_config = "Yes" if (path / f"{name}-config.yaml").exists() else "No"
row.extend([build_config, run_config])
config = "Yes" if (path / f"{name}-config.yaml").exists() else "No"
row.extend([config])
rows.append(row)
print_table(rows, headers, separate_rows=True)

View file

@ -31,8 +31,7 @@ def mock_distribs_base_dir(tmp_path):
# Create a custom distribution
starter_custom = custom_dir / "starter"
starter_custom.mkdir()
(starter_custom / "starter-build.yaml").write_text("# build config")
(starter_custom / "starter-config.yaml").write_text("# run config")
(starter_custom / "starter-config.yaml").write_text("# config")
return custom_dir
@ -47,8 +46,7 @@ def mock_distro_dir(tmp_path):
for distro_name in ["starter", "nvidia", "dell"]:
distro_path = distro_dir / distro_name
distro_path.mkdir()
(distro_path / "build.yaml").write_text("# build config")
(distro_path / "config.yaml").write_text("# run config")
(distro_path / "config.yaml").write_text("# config")
return distro_dir
@ -112,7 +110,7 @@ class TestStackList:
# Add a hidden directory
hidden_dir = mock_distro_dir / ".hidden"
hidden_dir.mkdir()
(hidden_dir / "build.yaml").write_text("# build")
(hidden_dir / "config.yaml").write_text("# config")
# Add a __pycache__ directory
pycache_dir = mock_distro_dir / "__pycache__"