Merge "Fix permission error in VNX driver"
This commit is contained in:
commit
cedf99f090
|
@ -1775,6 +1775,8 @@ test_get_pool_name:
|
|||
|
||||
test_normalize_config_naviseccli_path:
|
||||
|
||||
test_normalize_config_queue_path:
|
||||
|
||||
test_normalize_config_naviseccli_path_none:
|
||||
|
||||
test_normalize_config_pool_names:
|
||||
|
|
|
@ -13,8 +13,11 @@
|
|||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
import mock
|
||||
import os
|
||||
import re
|
||||
|
||||
from oslo_config import cfg
|
||||
|
||||
from cinder import context
|
||||
from cinder import exception
|
||||
from cinder.objects import fields
|
||||
|
@ -42,6 +45,7 @@ class TestCommonAdapter(test.TestCase):
|
|||
vnx_utils.init_ops(self.configuration)
|
||||
self.configuration.san_ip = '192.168.1.1'
|
||||
self.configuration.storage_vnx_authentication_type = 'global'
|
||||
self.configuration.config_group = 'vnx_backend'
|
||||
self.ctxt = context.get_admin_context()
|
||||
|
||||
def tearDown(self):
|
||||
|
@ -1241,6 +1245,15 @@ class TestCommonAdapter(test.TestCase):
|
|||
data['provider_location'])
|
||||
self.assertEqual('True', data['metadata']['snapcopy'])
|
||||
|
||||
@res_mock.patch_common_adapter
|
||||
def test_normalize_config_queue_path(self, common_adapter,
|
||||
mocked_res):
|
||||
common_adapter._normalize_config()
|
||||
self.assertEqual(os.path.join(cfg.CONF.state_path,
|
||||
'vnx',
|
||||
'vnx_backend'),
|
||||
common_adapter.queue_path)
|
||||
|
||||
@res_mock.patch_common_adapter
|
||||
def test_normalize_config_naviseccli_path(self, common_adapter,
|
||||
mocked_res):
|
||||
|
|
|
@ -15,9 +15,11 @@
|
|||
|
||||
import json
|
||||
import math
|
||||
import os
|
||||
import random
|
||||
import re
|
||||
|
||||
from oslo_config import cfg
|
||||
from oslo_log import log as logging
|
||||
from oslo_utils import importutils
|
||||
import six
|
||||
|
@ -36,6 +38,7 @@ from cinder.volume.drivers.dell_emc.vnx import utils
|
|||
from cinder.zonemanager import utils as zm_utils
|
||||
|
||||
|
||||
CONF = cfg.CONF
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
|
@ -94,9 +97,10 @@ class CommonAdapter(object):
|
|||
self.set_extra_spec_defaults()
|
||||
|
||||
def _normalize_config(self):
|
||||
self.queue_path = (
|
||||
group_name = (
|
||||
self.config.config_group if self.config.config_group
|
||||
else 'DEFAULT')
|
||||
self.queue_path = os.path.join(CONF.state_path, 'vnx', group_name)
|
||||
# Check option `naviseccli_path`.
|
||||
# Set to None (then pass to storops) if it is not set or set to an
|
||||
# empty string.
|
||||
|
|
Loading…
Reference in New Issue