Testing uploading a file to a bucket it silently fails if the bucket is configured as a website. Here is the sample code being used:
importgcloud.storageconnection=gcloud.storage.get_connection('project-id', 'email@developer.gserviceaccount.com', 'key-file.key')
bucket=connection.get_bucket('some.website.com')
path='answer.html'file_key=bucket.new_key(path)
file_key.set_contents_from_string('42')
key=bucket.get_key(path)
printkey.get_contents_as_string()When I run this against a normal bucket the file is saved and read correctly. When run against a bucket that is configured as a website the upload silently fails and is unable to retrieve the value from the bucket to print.
Testing uploading a file to a bucket it silently fails if the bucket is configured as a website. Here is the sample code being used:
When I run this against a normal bucket the file is saved and read correctly. When run against a bucket that is configured as a website the upload silently fails and is unable to retrieve the value from the bucket to print.