Beispiel #1
0
 def setBucketProperties(self, name, prop):
     bucket_path = self._getBucketPath(name)
     path = os.path.join(bucket_path,"global.xml")
     myDict = {}
     myDict['Global'] = prop.getDict()
     xml = DictToXml(myDict)
     self._writeFile(path,xml.getXml())
Beispiel #2
0
 def setObjectProperties(self, bucket_name, object_name, prop):
     object_path = self._getObjectPath(bucket_name,object_name)
     path = os.path.join(object_path,"object.xml")
     myDict = {}
     myDict['Global'] = prop.getDict()
     xml = DictToXml(myDict)
     self._writeFile(path,xml.getXml())
Beispiel #3
0
 def setBucketLocation(self, name,  location):
     bucket_path = self._getBucketPath(name)
     path = os.path.join(bucket_path,"location.xml")
     myDict = {}
     myDict['Location'] = location
     xml = DictToXml(myDict)
     self._writeFile(path,xml.getXml())
Beispiel #4
0
 def setBucketWebsite(self, name , w):
     bucket_path = self._getBucketPath(name)
     path = os.path.join(bucket_path,"website.xml")
     myDict = {}
     myDict['WebsiteConfiguration'] = w.getDict()
     xml = DictToXml(myDict)
     self._writeFile(path,xml.getXml())
Beispiel #5
0
 def setBucketVersioning(self, name , v):
     bucket_path = self._getBucketPath(name)
     path = os.path.join(bucket_path,"versioning.xml")
     myDict = {}
     myDict['VersioningConfiguration'] = v.getDict()
     xml = DictToXml(myDict)
     self._writeFile(path,xml.getXml())
Beispiel #6
0
    def setBucketACP(self, name , acp):
        bucket_path = self._getBucketPath(name)
        path = os.path.join(bucket_path,"acp.xml")
        myDict = {}
        myDict['ACP'] = {}
        myDict['ACP']['Grant'] = []
        for grant in acp.getGrantList():
            myDict['ACP']['Grant'].append(grant.getDict())

        xml = DictToXml(myDict)
        self._writeFile(path,xml.getXml())
Beispiel #7
0
    def setBucketLogging(self, name , log, target, prefix):
        bucket_path = self._getBucketPath(name)
        path = os.path.join(bucket_path,"logging.xml")
        myDict = {}
        myDict['Logging'] = {}
        myDict['Logging']['TargetBucket'] = target
        myDict['Logging']['TargetPrefix'] = prefix
        myDict['Logging']['TargetGrants'] = {}
        for grant in log.getGrantList():
            myDict['Logging']['TargetGrants']['Grant'].append(grant.getDict())

        xml = DictToXml(myDict)
        self._writeFile(path,xml.getXml())