Merge "Add additional filter to volume_type check" into stable/liberty

This commit is contained in:
Jenkins 2015-11-15 23:33:45 +00:00 committed by Gerrit Code Review
commit c5d08197e9
2 changed files with 6 additions and 2 deletions

View File

@ -0,0 +1,4 @@
---
fixes:
- Added additional filter to volume_type check,
closed bug #1508017

View File

@ -241,8 +241,8 @@ def check_volume_availability_zone_exist(az):
def check_volume_type_exists(volume_type):
volume_types = cinder.client().volume_types.list(search_opts={'name':
volume_type})
volume_types = cinder.client().volume_types.list()
volume_types = list(filter(lambda x: x.name == volume_type, volume_types))
if len(volume_types) == 1 and volume_types[0].name == volume_type:
return
raise ex.NotFoundException(volume_type, _("Volume type '%s' not found"))