Merge "Use oslo IntOpt function instead of explicit check"
This commit is contained in:
commit
de125f8693
@ -90,7 +90,9 @@ share_manager_opts = [
|
||||
'defines. This value reflects the shortest time Manila '
|
||||
'will wait for a share server to go unutilized before '
|
||||
'deleting it.',
|
||||
deprecated_group='DEFAULT'),
|
||||
deprecated_group='DEFAULT',
|
||||
min=10,
|
||||
max=60),
|
||||
cfg.IntOpt('replica_state_update_interval',
|
||||
default=300,
|
||||
help='This value, specified in seconds, determines how often '
|
||||
@ -182,7 +184,6 @@ class ShareManager(manager.SchedulerDependentManager):
|
||||
self.configuration = manila.share.configuration.Configuration(
|
||||
share_manager_opts,
|
||||
config_group=service_name)
|
||||
self._verify_unused_share_server_cleanup_interval()
|
||||
super(ShareManager, self).__init__(service_name='share',
|
||||
*args, **kwargs)
|
||||
|
||||
@ -2505,13 +2506,6 @@ class ShareManager(manager.SchedulerDependentManager):
|
||||
share_server['id'])
|
||||
self.driver.deallocate_network(context, share_server['id'])
|
||||
|
||||
def _verify_unused_share_server_cleanup_interval(self):
|
||||
if not 10 <= self.configuration.\
|
||||
unused_share_server_cleanup_interval <= 60:
|
||||
raise exception.InvalidParameterValue(
|
||||
"Option unused_share_server_cleanup_interval should be "
|
||||
"between 10 minutes and 1 hour.")
|
||||
|
||||
@add_hooks
|
||||
@utils.require_driver_initialized
|
||||
def extend_share(self, context, share_id, new_size, reservations):
|
||||
|
@ -2858,13 +2858,6 @@ class ShareManagerTestCase(test.TestCase):
|
||||
self.share_manager._validate_segmentation_id,
|
||||
network_info)
|
||||
|
||||
@ddt.data(5, 70)
|
||||
def test_verify_server_cleanup_interval_invalid_cases(self, val):
|
||||
data = dict(DEFAULT=dict(unused_share_server_cleanup_interval=val))
|
||||
with test_utils.create_temp_config_with_opts(data):
|
||||
self.assertRaises(exception.InvalidParameterValue,
|
||||
manager.ShareManager)
|
||||
|
||||
@ddt.data(10, 36, 60)
|
||||
def test_verify_server_cleanup_interval_valid_cases(self, val):
|
||||
data = dict(DEFAULT=dict(unused_share_server_cleanup_interval=val))
|
||||
|
Loading…
Reference in New Issue
Block a user