Add hbaapi path config option

In some cases, a vendor provided hbaapi library must be used for
Fibre Channel related operations.

This patch adds a config option, allowing the deployer to choose
such a library.

Change-Id: I830993e57870039ba2980e69b01952d5427638f2
This commit is contained in:
Lucian Petrut 2016-11-17 10:51:25 +02:00
parent d0a76796ad
commit 57f9ef084f
2 changed files with 30 additions and 1 deletions

26
os_win/conf.py Normal file
View File

@ -0,0 +1,26 @@
# Copyright 2017 Cloudbase Solutions Srl
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from oslo_config import cfg
os_win_opts = [
cfg.StrOpt('hbaapi_lib_path',
default='hbaapi.dll',
help='Fibre Channel hbaapi library path. If no custom hbaapi '
'library is requested, the default one will be used.'),
]
CONF = cfg.CONF
CONF.register_opts(os_win_opts, 'os_win')

View File

@ -23,12 +23,15 @@ from oslo_log import log as logging
from os_win._i18n import _, _LW
from os_win import _utils
import os_win.conf
from os_win import exceptions
from os_win.utils.storage.initiator import fc_structures as fc_struct
from os_win.utils import win32utils
CONF = os_win.conf.CONF
if sys.platform == 'win32':
hbaapi = ctypes.cdll.hbaapi
hbaapi = ctypes.cdll.LoadLibrary(CONF.os_win.hbaapi_lib_path)
LOG = logging.getLogger(__name__)