deb-manila/manila/share/drivers/dell_emc/plugin_manager.py
Ryan Liang 01391527ed Unity/VNX Driver: Rename driver options
- Never initialize the log by passing it in to `load_plugin`. Unity and VNX
  driver plugins initialize it in their implementation.
- Move plugins specific options from framework to Unity and VNX plugins.
- Rename driver options for Unity/VNX, the old ones are deprecated:
  emc_nas_pool_names -> unity_share_data_pools/vnx_share_data_pools,
  emc_nas_server_pool -> unity_server_meta_pool,
  emc_interface_ports -> unity_ethernet_ports/vnx_ethernet_ports,
  emc_nas_server_container -> unity_server_container/vnx_server_container.

DocImpact
Closes-Bug: 1652710
Change-Id: I8f1404de8dea9eeb09f1e5f6fc2538cefb0d63d9
2017-01-05 10:42:29 +08:00

32 lines
1.1 KiB
Python

# Copyright (c) 2014 EMC Corporation.
# 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.
"""EMC Share Driver Plugin Framework."""
from stevedore import extension
class EMCPluginManager(object):
def __init__(self, namespace):
self.namespace = namespace
self.extension_manager = extension.ExtensionManager(namespace)
def load_plugin(self, name, *args, **kwargs):
for ext in self.extension_manager.extensions:
if ext.name == name:
storage_conn = ext.plugin(*args, **kwargs)
return storage_conn
return None