Skip to content

Commit

Permalink
download with urn
Browse files Browse the repository at this point in the history
  • Loading branch information
kthare10 committed Aug 24, 2024
1 parent 8ed119c commit ecc3057
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion fabrictestbed/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__version__ = "1.7.3b1"
__version__ = "1.7.3b3"
__VERSION__ = __version__
4 changes: 0 additions & 4 deletions fabrictestbed/external_api/artifact_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,14 +264,10 @@ def download_artifact(self, urn: str, version: str, download_dir: str) -> str:
for chunk in response.iter_content(chunk_size=8192):
if chunk:
file.write(chunk)

print(f"Downloaded {urn} to {file_path}")
return file_path
except requests.HTTPError as e:
print(f"HTTPError: {e}")
raise ArtifactManagerError(f"HTTPError: {e}")
except Exception as e:
print(f"Exception: {e}")
raise ArtifactManagerError(f"Exception: {e}")

def delete_artifact(self, artifact_id: str):
Expand Down
2 changes: 1 addition & 1 deletion fabrictestbed/fabric_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ def download_artifact(self, download_dir: str, artifact_id: str = None, artifact
:raises ValueError: If neither `artifact_id` nor `artifact_title` is provided.
:raises FabricManagerException: If an error occurs during the download process.
"""
if artifact_id is None and artifact_title is None and version_urn:
if artifact_id is None and artifact_title is None and version_urn is None:
raise ValueError("Either artifact_id, artifact_title or version_urn must be specified!")
try:
am_proxy = ArtifactManager(api_url=self.am_host, token=self.ensure_valid_token())
Expand Down

0 comments on commit ecc3057

Please sign in to comment.