Kaydet (Commit) 334ac126 authored tarafından Daisuke Miyakawa's avatar Daisuke Miyakawa

Allow copy() to accept dictionary like diff()

Client.diff() silently convert container as a dictionary
to container['Id'] while Client.copy() does not.

This change makes copy() do the same job.
üst 99ce1f72
......@@ -403,6 +403,8 @@ class Client(requests.Session):
return res
def copy(self, container, resource):
if isinstance(container, dict):
container = container.get('Id')
res = self._post_json(
self._url("/containers/{0}/copy".format(container)),
data={"Resource": resource},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment