Why does glance client return an iterator but expect a file like object?
I'm a bit lost as to why the client returns an iterator for get but then expects a file like object for add. It would be great if both of these worked the same way. Then it would be possible to do something like:
from glance import client
remote = client.
local = client.
metadata, image = remote.
local.add_
It would also be nice if glance sanitized extra metadata in add as well. Even if the add / get were symmetrical, it fails because there are some keys that don't play nicely with add (id for example). The sanitization could be on the server end or a little helper method could theoretically be provided in the client:
metadata = client.
but it seems like the server should be smart enough to strip out metadata it can't handle.
I can add these as wishlist bugs, but I wanted to make sure there wasn't some reason that it worked this way before I started throwing things into the bug tracker.
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- Glance Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply: