Skip to content

Commit

Permalink
Causing download_target() to fail if updater is offline
Browse files Browse the repository at this point in the history
Signed-off-by: omartounsi7 <[email protected]>
Signed-off-by: Emile Baez <[email protected]>
  • Loading branch information
omartounsi7 authored and emilejbm committed May 27, 2023
1 parent d0e5529 commit 323eadf
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tuf/ngclient/updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,11 +237,15 @@ def download_target(
DownloadError: Download of the target file failed in some way
RepositoryError: Downloaded target failed to be verified in some way
OSError: Failed to write target to file
RuntimeError: Download of target file cannot occur because in offline mode
Returns:
Local path to downloaded file
"""

if self.config.offline:
raise RuntimeError("Cannot download when offline")

if filepath is None:
filepath = self._generate_target_file_path(targetinfo)

Expand Down

0 comments on commit 323eadf

Please sign in to comment.