eucalyptus/eutester

Can't delete_object or bucket

Closed this issue · 4 comments

Hi,
I do below tests, and failed because can not delete object or bucket:

  1. Create a bucket
  2. upload a object to the bucket
    3.delete the object ( Return WARN CRITICAL]: Walrus bucket still exists after delete
  3. delete the bucket ( can not return from this step)

Brs
Thanks.

BTW:
The detail information are below:

from eucaops import Eucaops
import os
tester = Eucaops(credpath="/root/lincx/eucarckey")
[2012-07-06 14:39:40,169] [EUTESTER] [DEBUG]: Extracting keys from /root/lincx/eucarckey
bucketname = "mybucket"
keyname = "mykey"
localfile = os.curdir+"/"+keyname
tester.local("touch "+localfile)
[]
tester.local("echo hello > "+localfile)
[]
bucket = tester.create_bucket(bucketname)
[2012-07-06 14:42:05,995] [EUTESTER] [DEBUG]: Created bucket: mybucket
tester.upload_object(bucket_name=bucketname,key_name=keyname,path_to_file=localfile)
[2012-07-06 14:44:00,730] [EUTESTER] [DEBUG]: Uploaded key: mykey to bucket:mybucket
<Key: mybucket,mykey>
obj = tester.get_objects_by_prefix(bucket_name=bucketname,prefix=keyname)
obj
<Key: mybucket,mykey>
tester.delete_object(obj)
[2012-07-06 14:45:10,222] [EUTESTER] [CRITICAL]: Walrus bucket still exists after delete #### what's mean of the warn?
tester.delete_bucket(bucket) #### it is suspent here and cannot return

Hi anthony,

Looks like i found the bug here, namely the delete object method has the improper error message. Can you check if the key does actually still exist? The code is looking for the key that it deleted and still finding it there. The warning should read "Key still exists after delete"

def delete_object(self, object):
bucket = object.bucket
name = object.name
object.delete()
try:
self.s3.get_bucket(bucket).get_key(name)
self.fail("Walrus bucket still exists after delete")
except Exception, e:
return

Just thought of another issue which may be that Eucalyptus is not returning the proper error code which causes boto to return without an exception.

I guess the self.fail("Walrus bucket still exists after delete") should be executed under exception, but not after get_bucket()
Current order:
try:
self.s3.get_bucket(bucket).get_key(name)
self.fail("Walrus bucket still exists after delete")
except Exception, e:
return

Should be :
try:
self.s3.get_bucket(bucket).get_key(name)
except Exception, e:
self.fail("Walrus bucket still exists after delete")

return

create_bucket and delete_bucket have been rewritten