Пример #1
0
    def normalize_config(self, config):
        config.unity_storage_pool_names = utils.remove_empty(
            '%s.unity_storage_pool_names' % config.config_group,
            config.unity_storage_pool_names)

        config.unity_io_ports = utils.remove_empty(
            '%s.unity_io_ports' % config.config_group, config.unity_io_ports)
        return config
Пример #2
0
    def normalize_config(self, config):
        config.unity_storage_pool_names = utils.remove_empty(
            '%s.unity_storage_pool_names' % config.config_group,
            config.unity_storage_pool_names)

        config.unity_io_ports = utils.remove_empty(
            '%s.unity_io_ports' % config.config_group,
            config.unity_io_ports)

        return config
Пример #3
0
 def test_remove_empty_empty_list(self):
     option = mock.Mock()
     value_list = []
     ret = utils.remove_empty(option, value_list)
     expected = None
     self.assertEqual(expected, ret)
Пример #4
0
 def test_remove_empty(self):
     option = mock.Mock()
     value_list = [' pool1', 'pool2 ', '     pool3  ']
     ret = utils.remove_empty(option, value_list)
     expected = ['pool1', 'pool2', 'pool3']
     self.assertListEqual(expected, ret)
Пример #5
0
 def test_remove_empty_empty_list(self):
     option = mock.Mock()
     value_list = []
     ret = utils.remove_empty(option, value_list)
     expected = None
     self.assertEqual(expected, ret)
Пример #6
0
 def test_remove_empty(self):
     option = mock.Mock()
     value_list = [' pool1', 'pool2 ', '     pool3  ']
     ret = utils.remove_empty(option, value_list)
     expected = ['pool1', 'pool2', 'pool3']
     self.assertListEqual(expected, ret)