Calls to create_volume (both volume_rpcapi and scheduler_rpcapi) pass
mandatory args as optional and reverse. This patch fixes the calls to be
according to the function definition.
Also, fix the call to create_volume in the migration code where
allow_reschedule defaults to True, but we don't pass request_spec so it
prints a warning and disables it.
Change-Id: I9509f88866e0ae182f90ebdfca1fcf415ca60d19
Closes-Bug: #
1230069
filter_properties.pop('context', None)
self.volume_rpcapi.create_volume(context, updated_volume, host,
- request_spec=request_spec,
- filter_properties=filter_properties,
+ request_spec, filter_properties,
allow_reschedule=True,
snapshot_id=snapshot_id,
image_id=image_id)
def fake_delete_volume_rpc(self, ctxt, vol_id):
raise Exception('should not be called')
- def fake_create_volume(self, ctxt, volume, host, req_spec, filters):
+ def fake_create_volume(self, ctxt, volume, host, req_spec, filters,
+ allow_reschedule=True):
db.volume_update(ctxt, volume['id'],
{'status': 'available'})
context,
CONF.volume_topic,
volume_id,
- snapshot_id,
- image_id,
+ snapshot_id=snapshot_id,
+ image_id=image_id,
request_spec=request_spec,
filter_properties=filter_properties)
else:
context,
volume_ref,
volume_ref['host'],
- request_spec=request_spec,
- filter_properties=filter_properties,
+ request_spec,
+ filter_properties,
allow_reschedule=False,
snapshot_id=snapshot_id,
image_id=image_id,
retry_info['exc'] = traceback.format_exception(*cause.exc_info)
return create_volume(context, CONF.volume_topic, volume_id,
- snapshot_id, image_id, request_spec,
- filter_properties)
+ snapshot_id=snapshot_id, image_id=image_id,
+ request_spec=request_spec,
+ filter_properties=filter_properties)
def _post_reschedule(self, context, volume_id):
"""Actions that happen after the rescheduling attempt occur here."""
new_vol_values['attach_status'] = 'detached'
new_volume = self.db.volume_create(ctxt, new_vol_values)
rpcapi.create_volume(ctxt, new_volume, host['host'],
- None, None)
+ None, None, allow_reschedule=False)
# Wait for new_volume to become ready
starttime = time.time()