mirror of
https://github.com/checktheroads/hyperglass
synced 2024-05-11 05:55:08 +00:00
fix reference error
This commit is contained in:
@@ -79,6 +79,11 @@ class Messages(HyperglassModel):
|
||||
title="No Output",
|
||||
description="Displayed when hyperglass can connect to a device and execute a query, but the response is empty.",
|
||||
)
|
||||
parsing_error: StrictStr = Field(
|
||||
"An error occurred while parsing the query output.",
|
||||
title="Parsing Error",
|
||||
description="Displayed when hyperglass can connect to a device and execute a query, but the response cannot be parsed.",
|
||||
)
|
||||
|
||||
class Config:
|
||||
"""Pydantic model configuration."""
|
||||
|
@@ -82,6 +82,7 @@ class Connect:
|
||||
"""
|
||||
log.debug(f"Pre-parsed responses:\n{output}")
|
||||
parsed = ()
|
||||
response = None
|
||||
if not self.device.structured_output:
|
||||
for coro in parsers:
|
||||
for response in output:
|
||||
@@ -96,6 +97,8 @@ class Connect:
|
||||
func = nos_parsers[self.device.nos][self.query_type]
|
||||
response = func(output)
|
||||
log.debug(f"Post-parsed responses:\n{response}")
|
||||
if response is None:
|
||||
raise ResponseEmpty(params.messages.parsing_error)
|
||||
return response
|
||||
|
||||
async def scrape_proxied(self):
|
||||
|
Reference in New Issue
Block a user