diff --git a/manila/scheduler/filters/driver.py b/manila/scheduler/filters/driver.py index 9b2bbe7746..539bad76dd 100644 --- a/manila/scheduler/filters/driver.py +++ b/manila/scheduler/filters/driver.py @@ -50,23 +50,9 @@ class DriverFilter(base_host.BaseHostFilter): Returns a tuple in the format (filter_passing, filter_invalid). Both values are booleans. """ - host_stats = stats['host_stats'] - extra_specs = stats['extra_specs'] - - # Check that the share types match - if extra_specs is None or 'share_backend_name' not in extra_specs: - LOG.warning("No 'share_backend_name' key in extra_specs. " - "Skipping share backend name check.") - elif (extra_specs['share_backend_name'] != - host_stats['share_backend_name']): - LOG.warning("Share backend names do not match: '%(target)s'" - "vs '%(current)s' :: Skipping.", - {'target': extra_specs['share_backend_name'], - 'current': host_stats['share_backend_name']}) - return False if stats['filter_function'] is None: - LOG.warning("Filter function not set :: passing host.") + LOG.debug("Filter function not set :: passing host.") return True try: diff --git a/manila/tests/scheduler/filters/test_driver.py b/manila/tests/scheduler/filters/test_driver.py index 7c54e18691..2cf07a4e93 100644 --- a/manila/tests/scheduler/filters/test_driver.py +++ b/manila/tests/scheduler/filters/test_driver.py @@ -82,24 +82,6 @@ class HostFiltersTestCase(test.TestCase): self.assertTrue(self.filter.host_passes(host1, filter_properties)) - def test_extra_specs_wrong_backend(self): - host1 = fakes.FakeHostState( - 'host1', { - 'capabilities': { - 'filter_function': '1 == 1', - } - }) - - filter_properties = { - 'share_type': { - 'extra_specs': { - 'share_backend_name': 'foo', - } - } - } - - self.assertFalse(self.filter.host_passes(host1, filter_properties)) - def test_function_extra_spec_replacement(self): host1 = fakes.FakeHostState( 'host1', { diff --git a/releasenotes/notes/fixing-driver-filter-14022294c8c04d2d.yaml b/releasenotes/notes/fixing-driver-filter-14022294c8c04d2d.yaml new file mode 100644 index 0000000000..e897e95d6a --- /dev/null +++ b/releasenotes/notes/fixing-driver-filter-14022294c8c04d2d.yaml @@ -0,0 +1,8 @@ +--- +fixes: + - | + Fixed the driver filter to not check for hard equality between the + share_backend_name and the name reported by the host as it defeats the + purpose of the capabilities filter giving the ability to use "" + selection operator in the extra-spec. Refer to `Launchpad bug 1815700 + `_ for more details.