Skip to content

Commit

Permalink
Merge pull request #1731 from jku/ngclient-arg-rename
Browse files Browse the repository at this point in the history
ngclient: Rename constructor arg
  • Loading branch information
lukpueh authored Dec 15, 2021
2 parents 551a10c + 2a6e773 commit 0285bf9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
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

0 comments on commit 0285bf9

Please sign in to comment.