Fix copy.py example.

Change-Id: Id2a58a085f58b0bf17eda636593bb482d614c245
This commit is contained in:
PAPAMICA 2022-01-12 09:57:05 +01:00 committed by Mickael Asseline
parent 3f5d5b0252
commit 4989d94663

View File

@ -9,17 +9,17 @@ logger = logging.getLogger(__name__)
with SwiftService() as swift: with SwiftService() as swift:
try: try:
obj = SwiftCopyObject("c", {"Destination": "/cont/d"}) obj = SwiftCopyObject("c", {"destination": "/cont/d"})
for i in swift.copy( for i in swift.copy(
"cont", ["a", "b", obj], "cont", ["a", "b", obj],
{"meta": ["foo:bar"], "Destination": "/cc"}): {"meta": ["foo:bar"], "destination": "/cc"}):
if i["success"]: if i["success"]:
if i["action"] == "copy_object": if i["action"] == "copy_object":
print( print(
"object %s copied from /%s/%s" % "object %s copied from /%s/%s" %
(i["destination"], i["container"], i["object"]) (i["destination"], i["container"], i["object"])
) )
if i["action"] == "create_container": elif i["action"] == "create_container":
print( print(
"container %s created" % i["container"] "container %s created" % i["container"]
) )