Merge pull request #1731 from jku/ngclient-arg-rename

ngclient: Rename constructor arg
This commit is contained in:
lukpueh 2021-12-15 14:31:58 +01:00 committed by GitHub
commit 0285bf9996
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 6 deletions

View file

@ -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,

View file

@ -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,

View file

@ -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/",
@ -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
@ -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: