mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-03 01:48:05 +00:00
chore: add a check for None
route.methods can be None so let's check for that to make mypy happy :) Signed-off-by: Sébastien Han <seb@redhat.com>
This commit is contained in:
parent
3ce509e94a
commit
1ffaa04f09
1 changed files with 10 additions and 7 deletions
|
|
@ -100,13 +100,16 @@ class DistributionInspectImpl(Inspect):
|
|||
router_routes = get_router_routes(router)
|
||||
for route in router_routes:
|
||||
if _should_include_router_route(route, router.prefix):
|
||||
ret.append(
|
||||
RouteInfo(
|
||||
route=route.path,
|
||||
method=next(iter([m for m in route.methods if m != "HEAD"])),
|
||||
provider_types=_get_provider_types(api),
|
||||
)
|
||||
)
|
||||
if route.methods is not None:
|
||||
available_methods = [m for m in route.methods if m != "HEAD"]
|
||||
if available_methods:
|
||||
ret.append(
|
||||
RouteInfo(
|
||||
route=route.path,
|
||||
method=available_methods[0],
|
||||
provider_types=_get_provider_types(api),
|
||||
)
|
||||
)
|
||||
|
||||
# Process routes from legacy webmethod-based APIs
|
||||
for api, endpoints in all_endpoints.items():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue