Revision e51c7d5b kamaki/clients/compute/__init__.py

b/kamaki/clients/compute/__init__.py
301 301
        r = self.servers_delete(server_id, key)
302 302
        return r.headers
303 303

  
304
    def list_flavors(self, detail=False):
304
    def list_flavors(self, detail=False, response_headers=dict(
305
            previous=None, next=None)):
305 306
        """
306 307
        :param detail: (bool) detailed flavor info if set, short if not
307 308

  
308 309
        :returns: (list) flavor info
309 310
        """
310
        r = self.flavors_get(command='detail' if detail else '')
311
        r = self.flavors_get(detail=bool(detail))
312
        for k, v in response_headers.items():
313
            response_headers[k] = r.headers.get(k, v)
311 314
        return r.json['flavors']
312 315

  
313 316
    def get_flavor_details(self, flavor_id):
......
319 322
        r = self.flavors_get(flavor_id)
320 323
        return r.json['flavor']
321 324

  
322
    def list_images(self, detail=False):
325
    def list_images(self, detail=False, response_headers=dict(
326
            next=None, previous=None)):
323 327
        """
324 328
        :param detail: (bool) detailed info if set, short if not
325 329

  
326 330
        :returns: dict id,name + full info if detail
327 331
        """
328
        detail = 'detail' if detail else ''
329
        r = self.images_get(command=detail)
332
        r = self.images_get(detail=bool(detail))
333
        for k, v in response_headers.items():
334
            response_headers[k] = r.headers.get(k, v)
330 335
        return r.json['images']
331 336

  
332 337
    def get_image_details(self, image_id, **kwargs):
......
351 356
        r = self.images_delete(image_id)
352 357
        return r.headers
353 358

  
354
    def get_image_metadata(self, image_id, key=''):
359
    def get_image_metadata(self, image_id, key='', response_headers=dict(
360
            previous=None, next=None)):
355 361
        """
356 362
        :param image_id: (str)
357 363

  
......
359 365

  
360 366
        :returns (dict) metadata if key not set, specific metadatum otherwise
361 367
        """
362
        command = path4url('metadata', key)
363
        r = self.images_get(image_id, command)
368
        r = self.images_metadata_get(image_id, key)
369
        for k, v in response_headers.items():
370
            response_headers[k] = r.headers.get(k, v)
364 371
        return r.json['meta' if key else 'metadata']
365 372

  
366 373
    def create_image_metadata(self, image_id, key, val):
......
377 384
        r = self.images_put(image_id, 'metadata/' + key, json_data=req)
378 385
        return r.json['meta']
379 386

  
380
    def update_image_metadata(self, image_id, **metadata):
387
    def update_image_metadata(
388
            self, image_id,
389
            response_headers=dict(previous=None, next=None), **metadata):
381 390
        """
382 391
        :param image_id: (str)
383 392

  
......
386 395
        :returns: updated metadata
387 396
        """
388 397
        req = {'metadata': metadata}
389
        r = self.images_post(image_id, 'metadata', json_data=req)
398
        r = self.images_metadata_post(image_id, json_data=req)
399
        for k, v in response_headers.items():
400
            response_headers[k] = r.headers.get(k, v)
390 401
        return r.json['metadata']
391 402

  
392 403
    def delete_image_metadata(self, image_id, key):

Also available in: Unified diff