-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #105 from newgene/enhancement-autohub-validator
Enhancement autohub: allow easily customize validation logic
- Loading branch information
Showing
4 changed files
with
55 additions
and
9 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
class AutoHubValidateError(Exception): | ||
reason = None | ||
|
||
def __init__(self, reason, *args, **kwargs): | ||
self.reason = reason | ||
super().__init__(*args, **kwargs) | ||
|
||
|
||
class AutoHubValidator: | ||
""" | ||
This class aims to provide an easy way to customize validation logic for installing a hub from a release. | ||
""" | ||
|
||
def __init__(self, auto_hub_feature): | ||
self.auto_hub_feature = auto_hub_feature | ||
|
||
def validate(self, force=False, **kwargs): | ||
""" | ||
Check if the release is valid to install. | ||
If invalid, it should raise an AutoHubValidateError include any reason to stop the progress. | ||
""" | ||
pass |