-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Verify sha256/sha1 of downloaded files (#3014)
- Loading branch information
Showing
9 changed files
with
87 additions
and
25 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
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
21 changes: 16 additions & 5 deletions
21
ansible/playbooks/roles/repository/files/download-requirements/src/error.py
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 |
---|---|---|
@@ -1,21 +1,32 @@ | ||
import logging | ||
|
||
|
||
class CriticalError(Exception): | ||
class DownloadRequirementsError(Exception): | ||
""" | ||
Raised when there was an error that could not be fixed by | ||
download-requirements script. | ||
Base class for all non standard errors raised during a script run. | ||
""" | ||
|
||
def __init__(self, msg: str): | ||
super().__init__() | ||
logging.error(msg) | ||
|
||
|
||
class CriticalError(DownloadRequirementsError): | ||
""" | ||
Raised when there was an error that could not be fixed by | ||
download-requirements script. | ||
""" | ||
|
||
|
||
class PackageNotfound(CriticalError): | ||
""" | ||
Raised when there was no package found by the query tool. | ||
""" | ||
|
||
|
||
class ChecksumMismatch(DownloadRequirementsError): | ||
""" | ||
Raised when there was a file checksum mismatch. | ||
""" | ||
def __init__(self, msg: str): | ||
super().__init__(msg) | ||
super().__init__(f'{msg} - download failed due to checksum mismatch, ' | ||
'WARNING someone might have replaced the file') |
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
1 change: 0 additions & 1 deletion
1
ansible/playbooks/roles/repository/files/download-requirements/src/run.py
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