|
@@ -151,8 +151,9 @@ class NoFileToDownload(Reason, _DataNodeReasonMixin):
|
|
|
"""
|
|
|
|
|
|
def __init__(self, file_path: str, datanode_id: str):
|
|
|
- Reason.__init__(self, f"Path '{file_path}' from data node '{datanode_id}'"
|
|
|
- f" does not exist and cannot be downloaded.")
|
|
|
+ Reason.__init__(
|
|
|
+ self, f"Path '{file_path}' from data node '{datanode_id}'" f" does not exist and cannot be downloaded"
|
|
|
+ )
|
|
|
_DataNodeReasonMixin.__init__(self, datanode_id)
|
|
|
|
|
|
|
|
@@ -165,8 +166,9 @@ class NotAFile(Reason, _DataNodeReasonMixin):
|
|
|
"""
|
|
|
|
|
|
def __init__(self, file_path: str, datanode_id: str):
|
|
|
- Reason.__init__(self, f"Path '{file_path}' from data node '{datanode_id}'"
|
|
|
- f" is not a file and can t be downloaded.")
|
|
|
+ Reason.__init__(
|
|
|
+ self, f"Path '{file_path}' from data node '{datanode_id}'" f" is not a file and can t be downloaded"
|
|
|
+ )
|
|
|
_DataNodeReasonMixin.__init__(self, datanode_id)
|
|
|
|
|
|
|
|
@@ -193,7 +195,7 @@ class EntityDoesNotExist(Reason, _DataNodeReasonMixin):
|
|
|
"""
|
|
|
|
|
|
def __init__(self, entity_id: str):
|
|
|
- Reason.__init__(self, f"Entity {entity_id} does not exist in the repository.")
|
|
|
+ Reason.__init__(self, f"Entity {entity_id} does not exist in the repository")
|
|
|
|
|
|
|
|
|
class JobIsNotFinished(Reason, _DataNodeReasonMixin):
|
|
@@ -205,7 +207,19 @@ class JobIsNotFinished(Reason, _DataNodeReasonMixin):
|
|
|
"""
|
|
|
|
|
|
def __init__(self, job_id: str):
|
|
|
- Reason.__init__(self, f"The job {job_id} is not finished yet.")
|
|
|
+ Reason.__init__(self, f"The job {job_id} is not finished yet")
|
|
|
+
|
|
|
+
|
|
|
+class EntityIsNotAScenario(Reason, _DataNodeReasonMixin):
|
|
|
+ """
|
|
|
+ The entity is not a scenario, which prevents specific actions from being performed.
|
|
|
+
|
|
|
+ Attributes:
|
|
|
+ entity_id (str): The entity identifier.
|
|
|
+ """
|
|
|
+
|
|
|
+ def __init__(self, entity_id: str):
|
|
|
+ Reason.__init__(self, f"The entity {entity_id} is not a scenario")
|
|
|
|
|
|
|
|
|
class ScenarioIsThePrimaryScenario(Reason, _DataNodeReasonMixin):
|
|
@@ -218,7 +232,7 @@ class ScenarioIsThePrimaryScenario(Reason, _DataNodeReasonMixin):
|
|
|
"""
|
|
|
|
|
|
def __init__(self, scenario_id: str, cycle: str):
|
|
|
- Reason.__init__(self, f"The scenario {scenario_id} is the primary scenario of cycle {cycle}.")
|
|
|
+ Reason.__init__(self, f"The scenario {scenario_id} is the primary scenario of cycle {cycle}")
|
|
|
|
|
|
|
|
|
class ScenarioDoesNotBelongToACycle(Reason, _DataNodeReasonMixin):
|
|
@@ -230,7 +244,7 @@ class ScenarioDoesNotBelongToACycle(Reason, _DataNodeReasonMixin):
|
|
|
"""
|
|
|
|
|
|
def __init__(self, scenario_id: str):
|
|
|
- Reason.__init__(self, f"The scenario {scenario_id} does not belong to any cycle.")
|
|
|
+ Reason.__init__(self, f"The scenario {scenario_id} does not belong to any cycle")
|
|
|
|
|
|
|
|
|
class SubmissionIsNotFinished(Reason, _DataNodeReasonMixin):
|
|
@@ -242,7 +256,7 @@ class SubmissionIsNotFinished(Reason, _DataNodeReasonMixin):
|
|
|
"""
|
|
|
|
|
|
def __init__(self, submission_id: str):
|
|
|
- Reason.__init__(self, f"The submission {submission_id} is not finished yet.")
|
|
|
+ Reason.__init__(self, f"The submission {submission_id} is not finished yet")
|
|
|
|
|
|
|
|
|
class SubmissionStatusIsUndefined(Reason, _DataNodeReasonMixin):
|
|
@@ -254,4 +268,4 @@ class SubmissionStatusIsUndefined(Reason, _DataNodeReasonMixin):
|
|
|
"""
|
|
|
|
|
|
def __init__(self, submission_id: str):
|
|
|
- Reason.__init__(self, f"The status of submission {submission_id} is undefined.")
|
|
|
+ Reason.__init__(self, f"The status of submission {submission_id} is undefined")
|