Revision dad1b874 kamaki/clients/image/__init__.py

b/kamaki/clients/image/__init__.py
198 198
        req = {'memberships': [{'member_id': member} for member in members]}
199 199
        r = self.put(path, json=req, success=204)
200 200
        return r.headers
201

  
202
    def update_image(
203
            self, image_id,
204
            name=None, disk_format=None, container_format=None,
205
            status=None, public=None, owner_id=None, **properties):
206
        path = path4url('images', image_id)
207
        if name is not None:
208
            self.set_header('X-Image-Meta-Name', name)
209
        if disk_format is not None:
210
            self.set_header('X-Image-Meta-Disk-Format', disk_format)
211
        if container_format is not None:
212
            self.set_header('X-Image-Meta-Container-Format', container_format)
213
        if status is not None:
214
            self.set_header('X-Image-Meta-Status', status)
215
        if public is not None:
216
            self.set_header('X-Image-Meta-Is-Public', bool(public))
217
        if owner_id is not None:
218
            self.set_header('X-Image-Meta-Owner', owner_id)
219
        for k, v in properties.items():
220
            self.set_header('X-Image-Meta-Property-%s' % k, v)
221
        r = self.put(path, success=200)
222
        return r.headers

Also available in: Unified diff