Python will not error on openvds.open() when incorrect credentials
The following code will give you a None handle without any error code/string. The None handle will still give you a valid VolumeDataAccessManager, but the subsequent VolumeSubsetRequest will fail:
import openvds
import numpy
AWS_BUCKET = 'bluware-vds-public-eu-north-1'
AWS_REGION = 'eu-north-1'
AWS_OBJECTID = '5790BB045F835E6B'
opt = openvds.AWSOpenOptions(bucket=AWS_BUCKET, region=AWS_REGION, key=AWS_OBJECTID)
err = openvds.Error()
try:
ovds = openvds.open(opt, err)
except:
print('Failed to Open VDS:' + err.string)
if err.code != 0:
print('Error code: ' + err.code)
if ovds is None:
print('No valid handle')
print(ovds)
acc = openvds.VolumeDataAccessManager(ovds)
print(acc)
r = acc.requestVolumeSubset((0,0,0),(100,100,100))
print(r)
With proper credentials, we get success: