Skip to content

Commit

Permalink
fix(transfer.py): fixed transfer daemon key error (#106)
Browse files Browse the repository at this point in the history
Added missing field on Archive model.
  • Loading branch information
odarotto authored Aug 6, 2024
1 parent 0ef7a42 commit b4e6f54
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions workflow/daemons/transfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ def check(payload: List[Dict[str, Any]]) -> List[Dict[str, Any]]:
"""
for data in payload:
for key in ["products", "plots", "logs"]:
if key not in data["config"]["archive"].keys():
continue
if data["config"]["archive"][key] == "pass":
data["config"]["archive"][key] = "bypass"
return payload
Expand Down
7 changes: 6 additions & 1 deletion workflow/definitions/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,13 @@ class Archive(BaseSettings):
description="Archive strategy for the plots.",
examples=["move"],
)
logs: str = Field(
default="move",
description="Archive strategy for the logs.",
examples=["move"],
)

@field_validator("products", "plots")
@field_validator("products", "plots", "logs")
def validate_archive(cls, value: str) -> str:
"""Validate the archive strategy.
Expand Down

0 comments on commit b4e6f54

Please sign in to comment.