Minor improvements

This commit is contained in:
thatmattlove 2021-12-06 12:14:00 -07:00
parent 8aedbaa93d
commit 55a9918fd0
4 changed files with 6 additions and 6 deletions

View file

@ -78,7 +78,7 @@ def _build_ui(timeout: int = typer.Option(180, help="Timeout in seconds")) -> No
f"Starting new UI build with a {timeout} second timeout...", spinner="aesthetic"
):
_build_ui()
_build_ui(timeout=120)
@cli.command(name="system-info")

View file

@ -30,7 +30,7 @@ if sys.version_info < MIN_PYTHON_VERSION:
# Ensure the NodeJS version meets the minimum requirements.
node_major, _, __ = get_node_version()
if node_major != MIN_NODE_VERSION:
if node_major < MIN_NODE_VERSION:
raise RuntimeError(f"NodeJS {MIN_NODE_VERSION!s}+ is required.")

View file

@ -22,7 +22,7 @@ class Credential(HyperglassModel, extra="allow"):
@root_validator
def validate_credential(cls, values):
"""Ensure either a password or an SSH key is set."""
if values["key"] is None and values["password"] is None:
if values.get("key") is None and values.get("password") is None:
raise ValueError(
"Either a password or an SSH key must be specified for user '{}'".format(
values["username"]

View file

@ -81,9 +81,9 @@ class HyperglassSettings(BaseSettings):
if value is None:
if values["debug"] is False:
return ip_address("127.0.0.1")
return ip_address("::1")
elif values["debug"] is True:
return ip_address("0.0.0.0")
return ip_address("::")
if isinstance(value, str):
if value != "localhost":
@ -93,7 +93,7 @@ class HyperglassSettings(BaseSettings):
raise ValueError(str(value))
elif value == "localhost":
return ip_address("127.0.0.1")
return ip_address("::1")
raise ValueError(str(value))