Skip to content

Commit

Permalink
Merge "Don't send snapshot requests through the scheduler"
Browse files Browse the repository at this point in the history
  • Loading branch information
Jenkins authored and openstack-gerrit committed Mar 21, 2012
2 parents f25cb41 + 22fd25d commit f934bee
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions nova/volume/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,11 +297,11 @@ def _create_snapshot(self, context, volume, name, description,
'display_description': description}

snapshot = self.db.snapshot_create(context, options)
host = volume['host']
rpc.cast(context,
FLAGS.scheduler_topic,
self.db.queue_get_for(context, FLAGS.volume_topic, host),
{"method": "create_snapshot",
"args": {"topic": FLAGS.volume_topic,
"volume_id": volume['id'],
"args": {"volume_id": volume['id'],
"snapshot_id": snapshot['id']}})
return snapshot

Expand All @@ -320,11 +320,12 @@ def delete_snapshot(self, context, snapshot):
raise exception.InvalidVolume(reason=msg)
self.db.snapshot_update(context, snapshot['id'],
{'status': 'deleting'})
volume = self.db.volume_get(context, snapshot['volume_id'])
host = volume['host']
rpc.cast(context,
FLAGS.scheduler_topic,
self.db.queue_get_for(context, FLAGS.volume_topic, host),
{"method": "delete_snapshot",
"args": {"topic": FLAGS.volume_topic,
"snapshot_id": snapshot['id']}})
"args": {"snapshot_id": snapshot['id']}})

@wrap_check_policy
def get_volume_metadata(self, context, volume):
Expand Down

0 comments on commit f934bee

Please sign in to comment.