List checkpoints: return a dictionary, not object
list_checkpoint() now returns a list of dictionaries, instead of the full checkpoint python object. Change-Id: I4107313d7873353b76f7e75e14149f02b18cff19
This commit is contained in:
parent
ed90462595
commit
c79a990758
|
@ -209,7 +209,8 @@ class ProtectionManager(manager.Manager):
|
|||
# TODO(wangliuan)
|
||||
pass
|
||||
|
||||
@messaging.expected_exceptions(exception.ProviderNotFound)
|
||||
@messaging.expected_exceptions(exception.ProviderNotFound,
|
||||
exception.CheckpointNotFound)
|
||||
def list_checkpoints(self, context, provider_id, marker=None, limit=None,
|
||||
sort_keys=None, sort_dirs=None, filters=None):
|
||||
LOG.info(_LI("Starting list checkpoints. "
|
||||
|
@ -232,7 +233,8 @@ class ProtectionManager(manager.Manager):
|
|||
start_date=start_date, end_date=end_date, sort_dir=sort_dir)
|
||||
checkpoints = []
|
||||
for checkpoint_id in checkpoint_ids:
|
||||
checkpoints.append(provider.get_checkpoint(checkpoint_id))
|
||||
checkpoint = provider.get_checkpoint(checkpoint_id)
|
||||
checkpoints.append(checkpoint.to_dict())
|
||||
return checkpoints
|
||||
|
||||
@messaging.expected_exceptions(exception.ProviderNotFound,
|
||||
|
|
Loading…
Reference in New Issue