Fix failure to load storage plugin
Watcher fails to load storage plugin in case there is no installed Cinder in OpenStack services. This patch set adds collector_plugins parameter under collector section in watcher.conf. If plugin name is in collector_plugins, The plugin is loaded. Change-Id: Ie3c3543216c925d49b772bf5fe3773ca7d5ae437 Closes-Bug: #1707603
This commit is contained in:
@@ -17,6 +17,8 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
from oslo_config import cfg
|
||||
|
||||
from watcher.common import utils
|
||||
from watcher.decision_engine.loading import default
|
||||
|
||||
@@ -31,8 +33,8 @@ class CollectorManager(object):
|
||||
def get_collectors(self):
|
||||
if self._collectors is None:
|
||||
collectors = utils.Struct()
|
||||
available_collectors = self.collector_loader.list_available()
|
||||
for collector_name in available_collectors:
|
||||
collector_plugins = cfg.CONF.collector.collector_plugins
|
||||
for collector_name in collector_plugins:
|
||||
collector = self.collector_loader.load(collector_name)
|
||||
collectors[collector_name] = collector
|
||||
self._collectors = collectors
|
||||
|
||||
Reference in New Issue
Block a user