forked from rucio/rucio
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
…cio#4845 Currently, a misleading error message is raised to the user upon attempting to move a rule which has an invalid Source Replica Expression (SRE). An invalid SRE is an RSE expression which evaluates to an empty set, which can occur due to a variety of reasons. The misleading error message informs the user that the provided `RSE expression is considered invalid`, this is misleading, since the error does not stem from the RSE expression provided to the `move_rule` command but from the SRE attribute of the rule prior to moving/updating it. The solution is to introduce a new exception `InvalidSourceReplicaExpression` and raise it within `core/rule.py::add_rule`, should the attempt to parse the SRE with `parse_expression` fail. This commit also includes a test added to `test_rule.py::TestCore` which simulates two ways in which the SRE might become invalid: 1) By deleting the only RSE the SRE points to. 2) By matching the RSE to the SRE via an RSE attribute but then deleting this RSE attribute from the RSE. In both cases the SRE will evaluate to an empty set.
- Loading branch information
Showing
3 changed files
with
87 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters