Merge "Tidy up - Rename Base"
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
from watcher.decision_engine.actions.base import BaseAction
|
||||
from watcher.decision_engine.model.hypervisor_state import HypervisorState
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
|
||||
from watcher.decision_engine.actions.base import BaseAction
|
||||
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
from watcher.decision_engine.actions.base import BaseAction
|
||||
from watcher.decision_engine.model.power_state import PowerState
|
||||
|
||||
@@ -47,5 +48,5 @@ class ChangePowerState(BaseAction):
|
||||
self._target = t
|
||||
|
||||
def __str__(self):
|
||||
return "ChangePowerState {} => {} ".format(
|
||||
self.target, self.powerstate)
|
||||
return "ChangePowerState {} => {} ".format(self.target,
|
||||
self.powerstate)
|
||||
|
||||
@@ -21,7 +21,7 @@ import six
|
||||
|
||||
|
||||
@six.add_metaclass(abc.ABCMeta)
|
||||
class Planner(object):
|
||||
class BasePlanner(object):
|
||||
@abc.abstractmethod
|
||||
def schedule(self, context, audit_uuid, solution):
|
||||
"""The planner receives a solution to schedule
|
||||
|
||||
@@ -21,7 +21,7 @@ from oslo_log import log
|
||||
from enum import Enum
|
||||
from watcher.common.exception import MetaActionNotFound
|
||||
from watcher.common import utils
|
||||
from watcher.decision_engine.planner.base import Planner
|
||||
from watcher.decision_engine.planner.base import BasePlanner
|
||||
|
||||
from watcher import objects
|
||||
|
||||
@@ -57,7 +57,7 @@ priority_primitives = {
|
||||
}
|
||||
|
||||
|
||||
class DefaultPlanner(Planner):
|
||||
class DefaultPlanner(BasePlanner):
|
||||
def create_action(self, action_plan_id, action_type, applies_to=None,
|
||||
src=None,
|
||||
dst=None,
|
||||
|
||||
@@ -21,7 +21,7 @@ import six
|
||||
|
||||
|
||||
@six.add_metaclass(abc.ABCMeta)
|
||||
class Solution(object):
|
||||
class BaseSolution(object):
|
||||
def __init__(self):
|
||||
self._origin = None
|
||||
self._model = None
|
||||
|
||||
@@ -17,12 +17,12 @@
|
||||
# limitations under the License.
|
||||
#
|
||||
from oslo_log import log
|
||||
from watcher.decision_engine.solution.base import Solution
|
||||
from watcher.decision_engine.solution.base import BaseSolution
|
||||
|
||||
LOG = log.getLogger(__name__)
|
||||
|
||||
|
||||
class DefaultSolution(Solution):
|
||||
class DefaultSolution(BaseSolution):
|
||||
def __init__(self):
|
||||
"""Stores a set of actions generated by a strategy
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ import six
|
||||
|
||||
|
||||
@six.add_metaclass(abc.ABCMeta)
|
||||
class Solution(object):
|
||||
class BaseSolutionComparator(object):
|
||||
@abc.abstractmethod
|
||||
def compare(self, sol1, sol2):
|
||||
raise NotImplementedError(
|
||||
|
||||
@@ -21,7 +21,7 @@ import six
|
||||
|
||||
|
||||
@six.add_metaclass(abc.ABCMeta)
|
||||
class SolutionEvaluator(object):
|
||||
class BaseSolutionEvaluator(object):
|
||||
@abc.abstractmethod
|
||||
def evaluate(self, solution):
|
||||
raise NotImplementedError(
|
||||
|
||||
@@ -49,7 +49,7 @@ class BaseStrategy(object):
|
||||
:param model: The name of the strategy to execute (loaded dynamically)
|
||||
:type model: str
|
||||
:return: A computed solution (via a placement algorithm)
|
||||
:rtype: :class:`watcher.decision_engine.solution.base.Solution`
|
||||
:rtype: :class:`watcher.decision_engine.solution.base.BaseSolution`
|
||||
"""
|
||||
|
||||
@property
|
||||
|
||||
@@ -21,7 +21,7 @@ import six
|
||||
|
||||
|
||||
@six.add_metaclass(abc.ABCMeta)
|
||||
class Selector(object):
|
||||
class BaseSelector(object):
|
||||
@abc.abstractmethod
|
||||
def define_from_goal(self, goal_name):
|
||||
raise NotImplementedError(
|
||||
|
||||
@@ -18,7 +18,7 @@ from oslo_config import cfg
|
||||
from oslo_log import log
|
||||
from watcher.common.exception import WatcherException
|
||||
from watcher.decision_engine.strategy.loader import StrategyLoader
|
||||
from watcher.decision_engine.strategy.selector.base import Selector
|
||||
from watcher.decision_engine.strategy.selector.base import BaseSelector
|
||||
LOG = log.getLogger(__name__)
|
||||
CONF = cfg.CONF
|
||||
|
||||
@@ -38,7 +38,7 @@ CONF.register_group(goals_opt_group)
|
||||
CONF.register_opts(WATCHER_GOALS_OPTS, goals_opt_group)
|
||||
|
||||
|
||||
class StrategySelector(Selector):
|
||||
class StrategySelector(BaseSelector):
|
||||
|
||||
def __init__(self):
|
||||
self.strategy_loader = StrategyLoader()
|
||||
|
||||
Reference in New Issue
Block a user