Add missing filter function in HSP driver

HSP driver merged without a filter function. Since the backend
does not support shares smaller than 128GB, this filter function
is needed so the scheduler does not choose its hosts for shares
of these sizes. This patch adds the default filter function to
the driver.

Change-Id: Ia00fb9540ac45992326e1d07c41a83a1d8a22a1e
Closes-bug: #1615616
This commit is contained in:
tpsilva 2016-08-22 09:40:29 -03:00
parent ef9e231b19
commit 9814b50bad
3 changed files with 13 additions and 0 deletions

View File

@ -319,3 +319,6 @@ class HitachiHSPDriver(driver.ShareDriver):
"%(shr_id)s is no longer being managed."),
{'shr_path': share['export_locations'][0]['path'],
'shr_id': share['id']})
def get_default_filter_function(self):
return "share.size >= 128"

View File

@ -413,3 +413,10 @@ class HitachiHSPTestCase(test.TestCase):
rest.HSPRestBackend.get_cluster.assert_called_once_with()
mock__update_share_stats.assert_called_once_with(fakes.stats_data)
self.assertTrue(self.mock_log.info.called)
def test_get_default_filter_function(self):
expected = "share.size >= 128"
actual = self._driver.get_default_filter_function()
self.assertEqual(expected, actual)

View File

@ -0,0 +1,3 @@
---
fixes:
- Added missing default filter function on Hitachi HSP driver.