diff --git a/releasenotes/notes/volume-type-check-58203c2df50999d2.yaml b/releasenotes/notes/volume-type-check-58203c2df50999d2.yaml new file mode 100644 index 0000000000..fdc1ae5cb4 --- /dev/null +++ b/releasenotes/notes/volume-type-check-58203c2df50999d2.yaml @@ -0,0 +1,4 @@ +--- +fixes: + - Added additional filter to volume_type check, + closed bug #1508017 diff --git a/sahara/service/validations/base.py b/sahara/service/validations/base.py index 15621ccf68..4062a237d2 100644 --- a/sahara/service/validations/base.py +++ b/sahara/service/validations/base.py @@ -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"))