Skip to content

Commit

Permalink
Add logs
Browse files Browse the repository at this point in the history
  • Loading branch information
stojanovskis1 committed Jul 23, 2024
1 parent 3f97b73 commit 16b7d2e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions ckanext/bulkupload/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
bulkupload = Blueprint("bulkupload", __name__)
try:
storage_path = config.get('ckan.storage_path')
log.info("12333333333333333333333")
log.info(storage_path)
except:
log.critical('''Please specify a ckan.storage_path in your config
for your uploads''')
Expand Down Expand Up @@ -182,12 +184,19 @@ def bulk_resource_upload(pkg_name):
x = tk.get_action("resource_create")(context, data_dict)
unique_filename = str(uuid.uuid4())[:8] + str(f.filename)
file_name = os.path.join(storage_path, unique_filename)
log.info("FILE NAMEEEEEEEEEEEEEEEEEEEEEEEEEEEE")
log.info(file_name)
f.save(file_name)

object_name = '/resources/' + x['id'] + '/' + url_striped
log.info("=========================")
log.info(object_name)

try:
response = s3_client.upload_file(file_name, bucket, object_name)
log.info("RESPONSE!!!!!!!!!!")
log.info(response)

except ClientError as e:
logging.error(e)

Expand Down

0 comments on commit 16b7d2e

Please sign in to comment.