Skip to content

Commit

Permalink
Modify check for volume-type-id to a get w/default
Browse files Browse the repository at this point in the history
While implementing Fix for a previous bug to enable setting
volume type on a cloned volume and reading it's info we added
a vref['volume_type_id'], problem is that the _do_clone method
is shared for both clone and create from snapshot.

In the create from snapshot case however that key doesn't exist
in the vref (which is a snapshot object).

This change turns this into a key.get with a default return.

Fixes bug: 1192745

Change-Id: I1a6d38de614f54fcaa31ea7cc4250aacc85b0796
  • Loading branch information
j-griffith committed Jun 19, 2013
1 parent 1482c40 commit 4838985
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cinder/volume/drivers/solidfire.py
Expand Up @@ -332,7 +332,7 @@ def _do_clone_volume(self, src_uuid, src_project_id, v_ref):
qos = self._set_qos_presets(v_ref)

ctxt = context.get_admin_context()
type_id = v_ref['volume_type_id']
type_id = v_ref.get('volume_type_id', None)
if type_id is not None:
qos = self._set_qos_by_volume_type(ctxt, type_id)

Expand Down

0 comments on commit 4838985

Please sign in to comment.