def getBucketLogging(self,bucket_name): bucket_path = self._getBucketPath(bucket_name) path = os.path.join(bucket_path,"logging.xml") if not os.path.exists(path): return None data = self._readFile(path) myDict = XmlToDict(data).getDict() list = myDict['Logging']['Grant'] grantList = [] if not type(list) is types.DictType: for grantDict in list: grant = Grant() grant.setByDict(grantDict) grantList.append(grant) else: grant = Grant() grant.setByDict(list) grantList.append(grant) log = BucketLogging() log.setByGrants(grantList) return log
def putBucketLogging(self, bucket_name , user, session, grantList, target, prefix ): self._LOGGER.info("PUT bucket-Logging") context = '' log = BucketLogging(target,prefix) log.setByGrants(grantList) self.meta.setBucketProperty(bucket_name,BF.PROPERTIES_LOGGING ,log, context) return
def putBucketLogging(self, bucket_name, user, session, grantList, target, prefix): self._LOGGER.info("PUT bucket-Logging") context = '' log = BucketLogging(target, prefix) log.setByGrants(grantList) self.meta.setBucketProperty(bucket_name, BF.PROPERTIES_LOGGING, log, context) return