Browse Source

AWS BucketObjectService find fix

almahmoud 7 năm trước cách đây
mục cha
commit
a5dfd42e4d

+ 1 - 1
cloudbridge/cloud/base/middleware.py

@@ -57,7 +57,7 @@ class BaseMiddleware(Middleware):
         discovered_handlers = []
         for key in dir(class_or_obj):
             try:
-                func = getattr(object, key)
+                func = getattr(class_or_obj, key)
             # Properties can sometimes cause various exceptions (e.g. during
             # auth failure testing)
             except Exception:

+ 2 - 1
cloudbridge/cloud/providers/aws/services.py

@@ -414,7 +414,8 @@ class AWSBucketObjectService(BaseBucketObjectService):
                                      limit=limit, marker=marker)
 
     def find(self, bucket, **kwargs):
-        obj_list = [AWSBucketObject(o) for o in bucket._bucket.objects.all()]
+        obj_list = [AWSBucketObject(self.provider, o)
+                    for o in bucket._bucket.objects.all()]
         filters = ['name']
         matches = cb_helpers.generic_find(filters, kwargs, obj_list)
         return ClientPagedResultList(self.provider, list(matches),