Compare commits

..

6 Commits
0.0.4 ... 0.0.5

Author SHA1 Message Date
Jenkins
25971fd867 Merge "Return actual object, not raw, when creating" 2016-06-28 09:27:19 +00:00
Yuval Brik
0644b6e175 Return actual object, not raw, when creating
When creating objects (checkpoint, plan, restore, scheduled operation,
trigger, etc) return the actual object, and not a raw dictionary.
Because a raw dictionary was returned on create and an actual object was
returned on get, this lead to the following confusion:

  checkpoint = smaug_client.checkpoint.create(...)
  checkpoint_id = checkpoint['id']
  checkpoint = smaug_client.checkpoint.get(...)
  checkpoint_id = checkpoint.id

Change-Id: I30c8eb4468d8fba830a64f336dd6cfa7793f0b48
2016-06-22 10:49:06 +03:00
OpenStack Proposal Bot
20139d066f Updated from global requirements
Change-Id: I78e0fa4c64e4a0916f25a7016c564d2d41861483
2016-06-21 18:05:49 +00:00
Jenkins
4225036154 Merge "The parameters of plan could be an empty dict without being configured" 2016-06-20 14:22:33 +00:00
chenying
db20090283 The parameters of plan could be an empty dict without being configured
Change-Id: Ife1796048a5830df707627aa7fcceae499699bff
2016-06-20 15:41:16 +08:00
OpenStack Proposal Bot
537ce1ed60 Updated from global requirements
Change-Id: I955acc77803e5f42f7f8d4d3a9af262df3e1c493
2016-06-01 13:54:35 +00:00
8 changed files with 16 additions and 17 deletions

View File

@@ -3,11 +3,11 @@
# process, which may cause wedges in the gate later.
pbr>=1.6 # Apache-2.0
PrettyTable<0.8,>=0.7 # BSD
python-keystoneclient!=1.8.0,!=2.1.0,>=1.6.0 # Apache-2.0
requests!=2.9.0,>=2.8.1 # Apache-2.0
python-keystoneclient!=1.8.0,!=2.1.0,>=1.7.0 # Apache-2.0
requests>=2.10.0 # Apache-2.0
simplejson>=2.2.0 # MIT
Babel>=1.3 # BSD
Babel>=2.3.4 # BSD
six>=1.9.0 # MIT
oslo.utils>=3.5.0 # Apache-2.0
oslo.utils>=3.11.0 # Apache-2.0
oslo.log>=1.14.0 # Apache-2.0
oslo.i18n>=2.1.0 # Apache-2.0

View File

@@ -30,7 +30,7 @@ class CheckpointManager(base.ManagerWithFind):
body = {'checkpoint': {'plan_id': plan_id}}
url = "/providers/{provider_id}/" \
"checkpoints" .format(provider_id=provider_id)
return self._create(url, body, 'checkpoint', return_raw=True)
return self._create(url, body, 'checkpoint')
def delete(self, provider_id, checkpoint_id):
path = '/providers/{provider_id}/checkpoints/' \

View File

@@ -31,7 +31,7 @@ class PlanManager(base.ManagerWithFind):
'parameters': parameters
}}
url = "/plans"
return self._create(url, body, 'plan', return_raw=True)
return self._create(url, body, 'plan')
def update(self, plan_id, data):

View File

@@ -32,7 +32,7 @@ class RestoreManager(base.ManagerWithFind):
}
}
url = "/restores"
return self._create(url, body, 'restore', return_raw=True)
return self._create(url, body, 'restore')
def delete(self, restore_id):
path = '/restores/{restore_id}'.format(

View File

@@ -32,7 +32,7 @@ class ScheduledOperationManager(base.ManagerWithFind):
operation_definition,
}}
url = "/scheduled_operations"
return self._create(url, body, 'scheduled_operation', return_raw=True)
return self._create(url, body, 'scheduled_operation')
def delete(self, scheduled_operation_id):
path = '/scheduled_operations/{scheduled_operation_id}'.\

View File

@@ -125,11 +125,10 @@ def do_plan_create(cs, args):
if args.parameters is not None:
plan_parameters = _extract_parameters(args)
else:
raise exceptions.CommandError(
"parameters must be provided.")
plan_parameters = {}
plan = cs.plans.create(args.name, args.provider_id, plan_resources,
plan_parameters)
utils.print_dict(plan)
utils.print_dict(plan.to_dict())
@utils.arg('plan',
@@ -238,7 +237,7 @@ def do_restore_create(cs, args):
"parameters must be provided.")
restore = cs.restores.create(args.provider_id, args.checkpoint_id,
args.restore_target, restore_parameters)
utils.print_dict(restore)
utils.print_dict(restore.to_dict())
def _extract_parameters(args):
@@ -513,7 +512,7 @@ def do_provider_list(cs, args):
def do_checkpoint_create(cs, args):
"""Create a checkpoint."""
checkpoint = cs.checkpoints.create(args.provider_id, args.plan_id)
utils.print_dict(checkpoint)
utils.print_dict(checkpoint.to_dict())
@utils.arg('provider_id',
@@ -717,7 +716,7 @@ def do_trigger_create(cs, args):
"""Create a trigger."""
trigger_properties = _extract_properties(args)
trigger = cs.triggers.create(args.name, args.type, trigger_properties)
utils.print_dict(trigger)
utils.print_dict(trigger.to_dict())
def _extract_properties(args):
@@ -870,7 +869,7 @@ def do_scheduledoperation_create(cs, args):
args.operation_type,
args.trigger_id,
operation_definition)
utils.print_dict(scheduledoperation)
utils.print_dict(scheduledoperation.to_dict())
def _extract_operation_definition(args):

View File

@@ -30,7 +30,7 @@ class TriggerManager(base.ManagerWithFind):
'properties': properties,
}}
url = "/triggers"
return self._create(url, body, 'trigger_info', return_raw=True)
return self._create(url, body, 'trigger_info')
def delete(self, trigger_id):
path = '/triggers/{trigger_id}'.format(

View File

@@ -7,7 +7,7 @@ hacking<0.11,>=0.10.2 # Apache-2.0
coverage>=3.6 # Apache-2.0
discover # BSD
python-subunit>=0.0.18 # Apache-2.0/BSD
sphinx!=1.2.0,!=1.3b1,<1.3,>=1.1.2 # BSD
sphinx!=1.3b1,<1.3,>=1.2.1 # BSD
oslosphinx!=3.4.0,>=2.5.0 # Apache-2.0
oslotest>=1.10.0 # Apache-2.0
testrepository>=0.0.18 # Apache-2.0/BSD