Merge "Fix: failed to create snapshot with DriverFilter"

This commit is contained in:
Zuul 2020-01-22 11:44:34 +00:00 committed by Gerrit Code Review
commit 314f3a4596
1 changed files with 6 additions and 1 deletions

View File

@ -287,7 +287,12 @@ class FilterScheduler(driver.Scheduler):
# takes 'resource_XX' and 'volume_XX' as input respectively, copying
# 'volume_XX' to 'resource_XX' will make both filters happy.
volume_type = request_spec.get("volume_type")
resource_type = volume_type if volume_type is not None else {}
# When creating snapshots, the value of volume_type is None here
# which causes issues in filters (Eg: Bug #1856126).
# To prevent that, we set it as an empty dictionary here.
if volume_type is None:
volume_type = {}
resource_type = volume_type
config_options = self._get_configuration_options()