Skip to content

Commit

Permalink
Rename attribute & updates
Browse files Browse the repository at this point in the history
  • Loading branch information
viniciusdc committed Jan 18, 2024
1 parent 3c1259f commit 69917cc
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 19 deletions.
19 changes: 1 addition & 18 deletions src/_nebari/stages/kubernetes_services/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,24 +356,6 @@ class JupyterhubInputVars(schema.Base):
argo_workflows_enabled: bool = Field(alias="argo-workflows-enabled")
jhub_apps_enabled: bool = Field(alias="jhub-apps-enabled")

@pydantic.validator("initial_repositories")
def check_prepopulated_repositories(cls, v, values):
if v is not None:
for pairs in v:
for _path, _repo in pairs.items():
if not (isinstance(_path, str) or isinstance(_repo, str)):
raise ValueError(
f"Prepopulated repositories must be strings, got {type(_path)} and {type(_repo)}"
)
if _path.startswith("/") or _path.endswith("/"):
raise ValueError(
f"Prepopulated repositories must be in the format path/to/repo without leading or trailing slashes, got {_path}"
)
if not (_repo.startswith("https://") or _repo.endswith(".git")):
raise ValueError(
f"Prepopulated repositories must be https urls, got {_repo}"
)


class DaskGatewayInputVars(schema.Base):
dask_worker_image: ImageNameTag = Field(alias="dask-worker-image")
Expand Down Expand Up @@ -493,6 +475,7 @@ def input_vars(self, stage_outputs: Dict[str, Dict[str, Any]]):
print(
f"Pre populating repositories: {self.config.jupyterlab.initial_repositories} \n"
)
print(f"JupyterLab settings {self.config.jupyterlab.dict()} \n")

jupyterhub_vars = JupyterhubInputVars(
jupyterhub_theme=jupyterhub_theme.dict(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,8 @@ def string_to_objects(input_string):
"Input string does not contain a list of dictionaries."
)
except (ValueError, SyntaxError):
raise ValueError("Invalid input string format.")
# Return an error message if the input string is not a list of dictionaries
raise ValueError(f"Invalid input string format: {input_string}")

git_repos_provision_pvc = string_to_objects(git_repos_provision_pvc)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,4 +171,5 @@ variable "jupyterlab-pioneer-log-format" {
variable "initial-repositories" {
description = "Map of folder location and git repo url to clone"
type = string
default = "[]"
}

0 comments on commit 69917cc

Please sign in to comment.