-
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.
Enhancement autohub validator: allow easily customize validator logic
- Loading branch information
1 parent
12f9c8d
commit 0747063
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 |