MCPcopy Create free account
hub / github.com/s3tools/s3cmd / setAclPublic

Method setAclPublic

S3/AccessLog.py:65–82  ·  view source on GitHub ↗
(self, acl_public)

Source from the content-addressed store, hash-verified

63 return ""
64
65 def setAclPublic(self, acl_public):
66 le = self.tree.find(".//LoggingEnabled")
67 if le is None:
68 raise ParameterError("Logging not enabled, can't set default ACL for logs")
69 tg = le.find(".//TargetGrants")
70 if not acl_public:
71 if not tg:
72 ## All good, it's not been there
73 return
74 else:
75 le.remove(tg)
76 else: # acl_public == True
77 anon_read = GranteeAnonRead().getElement()
78 if not tg:
79 tg = ET.SubElement(le, "TargetGrants")
80 ## What if TargetGrants already exists? We should check if
81 ## AnonRead is there before appending a new one. Later...
82 tg.append(anon_read)
83
84 def isAclPublic(self):
85 raise NotImplementedError()

Callers 2

set_accesslogMethod · 0.95
AccessLog.pyFile · 0.80

Calls 3

ParameterErrorClass · 0.85
GranteeAnonReadClass · 0.85
getElementMethod · 0.80

Tested by

no test coverage detected