Coverage for watcher/decision_engine/planner/manager.py: 100%

12 statements  

« prev     ^ index     » next       coverage.py v7.8.2, created at 2025-06-17 12:22 +0000

1# -*- encoding: utf-8 -*- 

2# Copyright (c) 2016 b<>com 

3# 

4# Licensed under the Apache License, Version 2.0 (the "License"); 

5# you may not use this file except in compliance with the License. 

6# You may obtain a copy of the License at 

7# 

8# http://www.apache.org/licenses/LICENSE-2.0 

9# 

10# Unless required by applicable law or agreed to in writing, software 

11# distributed under the License is distributed on an "AS IS" BASIS, 

12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 

13# implied. 

14# See the License for the specific language governing permissions and 

15# limitations under the License. 

16# 

17 

18from oslo_log import log 

19 

20from watcher.decision_engine.loading import default as loader 

21 

22LOG = log.getLogger(__name__) 

23 

24 

25class PlannerManager(object): 

26 def __init__(self): 

27 self._loader = loader.DefaultPlannerLoader() 

28 

29 @property 

30 def loader(self): 

31 return self._loader 

32 

33 def load(self, planner_name): 

34 LOG.debug("Loading %s", planner_name) 

35 return self.loader.load(name=planner_name)