Skip to content

Commit

Permalink
fix(fixing-workspace-reading): Fixed post_model_validator()
Browse files Browse the repository at this point in the history
  • Loading branch information
odarotto committed Feb 21, 2024
1 parent b6a4148 commit 7d0e900
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
7 changes: 2 additions & 5 deletions workflow/cli/run.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Fetch and process Work using any method compatible with Tasks API."""


import platform
import signal
import time
Expand Down Expand Up @@ -272,9 +271,7 @@ def attempt(

# Get work from the workflow backend
try:
work = Work.withdraw(
pipeline=bucket, site=site, tags=tags, parent=parent
)
work = Work.withdraw(pipeline=bucket, site=site, tags=tags, parent=parent)
except Exception as error:
logger.exception(error)

Expand Down Expand Up @@ -314,7 +311,7 @@ def attempt(
]
if any(work.notify.slack.dict().values()) and work.plots:
work.plots = [f"<{product_url}{plot}|{plot}>" for plot in work.plots]
work.update(**kwargs) # type: ignore
work.update() # type: ignore
logger.info("work completed: ✅")
unset_tag()
return status
Expand Down
2 changes: 1 addition & 1 deletion workflow/definitions/work.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ def post_model_validation(self) -> "Work":
Work: The current work object.
"""
# Validate if the site provided is allowed in the workspace.
config: Dict[str, Any] = read.workspace(self.workspace.as_posix())
config: Dict[str, Any] = read.workspace(self.workspace)
sites: List[str] = config.get("sites", [])
if self.site not in sites:
error = (
Expand Down

0 comments on commit 7d0e900

Please sign in to comment.