Revision 82482e2c pithos/backends/modular.py

b/pithos/backends/modular.py
154 154
        return allowed[start:start + limit]
155 155
    
156 156
    @backend_method
157
    def get_account_meta(self, user, account, domain, until=None):
157
    def get_account_meta(self, user, account, domain, until=None, include_user_defined=True):
158 158
        """Return a dictionary with the account metadata for the domain."""
159 159
        
160 160
        logger.debug("get_account_meta: %s %s %s", account, domain, until)
......
180 180
            meta = {'name': account}
181 181
        else:
182 182
            meta = {}
183
            if props is not None:
183
            if props is not None and include_user_defined:
184 184
                meta.update(dict(self.node.attribute_get(props[self.SERIAL], domain)))
185 185
            if until is not None:
186 186
                meta.update({'until_timestamp': tstamp})
......
316 316
        return self.node.latest_attribute_keys(node, domain, before, CLUSTER_DELETED, allowed)
317 317
    
318 318
    @backend_method
319
    def get_container_meta(self, user, account, container, domain, until=None):
319
    def get_container_meta(self, user, account, container, domain, until=None, include_user_defined=True):
320 320
        """Return a dictionary with the container metadata for the domain."""
321 321
        
322 322
        logger.debug("get_container_meta: %s %s %s %s", account, container, domain, until)
......
337 337
        if user != account:
338 338
            meta = {'name': container}
339 339
        else:
340
            meta = dict(self.node.attribute_get(props[self.SERIAL], domain))
340
            meta = {}
341
            if include_user_defined:
342
                meta.update(dict(self.node.attribute_get(props[self.SERIAL], domain)))
341 343
            if until is not None:
342 344
                meta.update({'until_timestamp': tstamp})
343 345
            meta.update({'name': container, 'count': count, 'bytes': bytes})
......
491 493
        return public
492 494
    
493 495
    @backend_method
494
    def get_object_meta(self, user, account, container, name, domain, version=None):
496
    def get_object_meta(self, user, account, container, name, domain, version=None, include_user_defined=True):
495 497
        """Return a dictionary with the object metadata for the domain."""
496 498
        
497 499
        logger.debug("get_object_meta: %s %s %s %s %s", account, container, name, domain, version)
......
509 511
                    raise NameError('Object does not exist')
510 512
                modified = del_props[self.MTIME]
511 513
        
512
        meta = dict(self.node.attribute_get(props[self.SERIAL], domain))
514
        meta = {}
515
        if include_user_defined:
516
            meta.update(dict(self.node.attribute_get(props[self.SERIAL], domain)))
513 517
        meta.update({'name': name,
514 518
                     'bytes': props[self.SIZE],
515 519
                     'type': props[self.TYPE],

Also available in: Unified diff