forked from mirrors/thatmattlove-hyperglass
fix image validation errors
This commit is contained in:
parent
7dfc72c2e7
commit
5e91836978
2 changed files with 4 additions and 3 deletions
|
|
@ -24,6 +24,7 @@ from hyperglass.constants import (
|
|||
DEFAULT_DETAILS,
|
||||
LOG_HANDLER_FILE,
|
||||
SUPPORTED_QUERY_TYPES,
|
||||
__version__,
|
||||
)
|
||||
from hyperglass.exceptions import ConfigError, ConfigInvalid, ConfigMissing
|
||||
from hyperglass.configuration.models import params as _params
|
||||
|
|
@ -437,6 +438,7 @@ _frontend_fields = {
|
|||
_frontend_params = params.dict(include=_frontend_fields)
|
||||
_frontend_params.update(
|
||||
{
|
||||
"hyperglass_version": __version__,
|
||||
"queries": {**params.queries.map, "list": params.queries.list},
|
||||
"devices": frontend_devices,
|
||||
"networks": networks,
|
||||
|
|
|
|||
|
|
@ -151,8 +151,7 @@ def validate_image(value):
|
|||
|
||||
if base_path[0] not in ("images", "custom"):
|
||||
raise ValueError(
|
||||
"Logo files must be in the 'custom/' directory of your hyperglass directory. Got: {f}",
|
||||
f=value,
|
||||
f"Logo files must be in the 'custom/' directory of your hyperglass directory. Got: {value}"
|
||||
)
|
||||
|
||||
if base_path[0] == "custom":
|
||||
|
|
@ -160,6 +159,6 @@ def validate_image(value):
|
|||
custom_file = config_path / "static" / value
|
||||
|
||||
if not custom_file.exists():
|
||||
raise ValueError("'{f}' does not exist", f=str(custom_file))
|
||||
raise ValueError(f"'{str(custom_file)}' does not exist")
|
||||
|
||||
return value
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue