]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Huawei: Fix create volume with prefetch value error
authorhuyang <huyang1@huawei.com>
Wed, 24 Feb 2016 08:12:19 +0000 (16:12 +0800)
committerhuyang <huyang1@huawei.com>
Wed, 24 Feb 2016 08:22:28 +0000 (16:22 +0800)
In Huawei driver, when we create volume with
prefetch configurated in xml, the prefetch value
on the array is incorrect. So fix it.

Change-Id: I69b81eec47ae7663857cfb461aba32109746dbc0
Closes-Bug: #1549161

cinder/volume/drivers/huawei/huawei_conf.py

index f4781dee5ce4dae292f6378a151719561373c542..94ded9796abc1b6b4162cda1dad362a1661e36b6 100644 (file)
@@ -197,8 +197,8 @@ class HuaweiConf(object):
                 raise exception.InvalidInput(reason=msg)
 
             prefetch_value = node.attrib['Value'].strip()
-            factor = {'1': 2, '2': 2}
-            factor = int(factor.get('prefetch_type', '1'))
+            factor = {'1': 2}
+            factor = int(factor.get(prefetch_type, '1'))
             prefetch_value = int(prefetch_value) * factor
             prefetch_value = six.text_type(prefetch_value)