Skip to content

ngclient: Rename constructor arg #1731

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/client_example/client_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def download(target: str) -> bool:
"""
try:
updater = Updater(
repository_dir=METADATA_DIR,
metadata_dir=METADATA_DIR,
metadata_base_url=f"{BASE_URL}/metadata/",
target_base_url=f"{BASE_URL}/targets/",
target_dir=DOWNLOAD_DIR,
Expand Down
2 changes: 1 addition & 1 deletion tests/test_updater_ng.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def setUp(self) -> None:
# Creating a repository instance. The test cases will use this client
# updater to refresh metadata, fetch target files, etc.
self.updater = ngclient.Updater(
repository_dir=self.client_directory,
metadata_dir=self.client_directory,
metadata_base_url=self.metadata_url,
target_dir=self.dl_dir,
target_base_url=self.targets_url,
Expand Down
8 changes: 4 additions & 4 deletions tuf/ngclient/updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
# Load trusted local root metadata from client metadata cache. Define
# where metadata and targets will be downloaded from.
updater = Updater(
repository_dir="~/tufclient/metadata/",
metadata_dir="~/tufclient/metadata/",
metadata_base_url="http://localhost:8000/tuf-repo/",
target_dir="~/tufclient/downloads/",
target_base_url="http://localhost:8000/targets/",
Expand Down Expand Up @@ -87,7 +87,7 @@ class Updater:
"""Creates a new Updater instance and loads trusted root metadata.

Args:
repository_dir: Local metadata directory. Directory must be
metadata_dir: Local metadata directory. Directory must be
writable and it must contain a trusted root.json file.
metadata_base_url: Base URL for all remote metadata downloads
target_dir: Local targets directory. Directory must be writable. It
Expand All @@ -105,14 +105,14 @@ class Updater:

def __init__(
self,
repository_dir: str,
metadata_dir: str,
metadata_base_url: str,
target_dir: Optional[str] = None,
target_base_url: Optional[str] = None,
fetcher: Optional[FetcherInterface] = None,
config: Optional[UpdaterConfig] = None,
):
self._dir = repository_dir
self._dir = metadata_dir
self._metadata_base_url = _ensure_trailing_slash(metadata_base_url)
self.target_dir = target_dir
if target_base_url is None:
Expand Down