Skip to content

Commit

Permalink
Merge pull request #1849 from singnet/Fix-naming
Browse files Browse the repository at this point in the history
Fix naming
  • Loading branch information
mirel-dev authored Nov 14, 2024
2 parents e40d7c0 + fb87f33 commit 615f7fe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions common/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,16 +238,16 @@ def publish_file_in_ipfs(file_url, file_dir, ipfs_client, wrap_with_directory=Tr
file_type = os.path.splitext(filename)[1]
logger.info(f" file type is = '{file_type.lower()}` ")
if file_type.lower() == ".zip":
return publish_zip_file_in_ipfs(filename, file_dir, ipfs_client, ingored_files=ignored_files)
return publish_zip_file_in_ipfs(filename, file_dir, ipfs_client, ignored_files=ignored_files)
#todo , you need to tar the folder and add that to the ipfs hash
logger.info(f"writing the file on ipfs {file_dir}/{filename} ")
ipfs_hash = ipfs_client.write_file_in_ipfs(f"{file_dir}/{filename}", wrap_with_directory)
return ipfs_hash


def publish_zip_file_in_ipfs(filename, file_dir, ipfs_client, ingored_files=[]):
def publish_zip_file_in_ipfs(filename, file_dir, ipfs_client, ignored_files=[]):
logger.info(f"publish_zip_file_in_ipfs {file_dir}/{filename} ")
file_in_tar_bytes = convert_zip_file_to_tar_bytes(file_dir=file_dir, filename=filename, ingored_files=ingored_files)
file_in_tar_bytes = convert_zip_file_to_tar_bytes(file_dir=file_dir, filename=filename, ignored_files=ignored_files)
logger.info(f"file_in_tar_bytes {file_in_tar_bytes} ")
return ipfs_client.ipfs_conn.add_bytes(file_in_tar_bytes.getvalue())

Expand Down
2 changes: 1 addition & 1 deletion registry/application/services/service_publisher_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ def publish_service_data_to_ipfs(self):
filename=filename,
file_dir=f"{ASSET_DIR}/{service.org_uuid}/{service.uuid}",
ipfs_client=IPFSUtil(IPFS_URL['url'], IPFS_URL['port']),
ingored_files=["pricing.proto", "training.proto"]
ignored_files=["pricing.proto", "training.proto"]
)
service.proto = {
"model_ipfs_hash": asset_ipfs_hash,
Expand Down

0 comments on commit 615f7fe

Please sign in to comment.