def getObjectACP(self,bucket_name,object_name): object_path = self._getObjectPath(bucket_name,object_name) path = os.path.join(object_path,"acp.xml") if not os.path.exists(path): return None data = self._readFile(path) myDict = XmlToDict(data).getDict() list = myDict['ACP']['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) acp = ACP() acp.setByGrants(grantList) return acp
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