Code refactoring - Watcher Decision Engine package
This patchset is there to change the code structure. The objective is to flatten the project file tree by merging 'api/' and 'framework/' into a single package. This also contains some tidy ups in package naming (like using only singular nouns). This should only affect file/folder names and their subsequent import paths wherever they were used. Change-Id: Ie903ba20ca5cf03b0b42efa60131d1b919b0c2c9
This commit is contained in:
@@ -22,7 +22,8 @@ import pecan
|
|||||||
from watcher.api import acl
|
from watcher.api import acl
|
||||||
from watcher.api import config as api_config
|
from watcher.api import config as api_config
|
||||||
from watcher.api import middleware
|
from watcher.api import middleware
|
||||||
from watcher.decision_engine.framework.strategy import strategy_selector
|
from watcher.decision_engine.strategy.selector import default \
|
||||||
|
as strategy_selector
|
||||||
|
|
||||||
# Register options for the service
|
# Register options for the service
|
||||||
API_SERVICE_OPTS = [
|
API_SERVICE_OPTS = [
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ from watcher.api.controllers.v1 import types
|
|||||||
from watcher.api.controllers.v1 import utils as api_utils
|
from watcher.api.controllers.v1 import utils as api_utils
|
||||||
from watcher.common import exception
|
from watcher.common import exception
|
||||||
from watcher.common import utils
|
from watcher.common import utils
|
||||||
from watcher.decision_engine.framework.rpcapi import DecisionEngineAPI
|
from watcher.decision_engine.rpcapi import DecisionEngineAPI
|
||||||
from watcher import objects
|
from watcher import objects
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ from watcher.applier.api.primitive_command import PrimitiveCommand
|
|||||||
from watcher.applier.api.promise import Promise
|
from watcher.applier.api.promise import Promise
|
||||||
from watcher.applier.framework.command.wrapper.nova_wrapper import NovaWrapper
|
from watcher.applier.framework.command.wrapper.nova_wrapper import NovaWrapper
|
||||||
from watcher.common.keystone import Client
|
from watcher.common.keystone import Client
|
||||||
from watcher.decision_engine.framework.model.hypervisor_state import \
|
from watcher.decision_engine.model.hypervisor_state import \
|
||||||
HypervisorState
|
HypervisorState
|
||||||
|
|
||||||
CONF = cfg.CONF
|
CONF = cfg.CONF
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ from watcher.applier.api.primitive_command import PrimitiveCommand
|
|||||||
from watcher.applier.api.promise import Promise
|
from watcher.applier.api.promise import Promise
|
||||||
from watcher.applier.framework.command.wrapper.nova_wrapper import NovaWrapper
|
from watcher.applier.framework.command.wrapper.nova_wrapper import NovaWrapper
|
||||||
from watcher.common.keystone import Client
|
from watcher.common.keystone import Client
|
||||||
from watcher.decision_engine.framework.default_planner import Primitives
|
from watcher.decision_engine.planner.default import Primitives
|
||||||
|
|
||||||
CONF = cfg.CONF
|
CONF = cfg.CONF
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ from watcher.applier.framework.command.nop_command import NopCommand
|
|||||||
from watcher.applier.framework.command.power_state_command import \
|
from watcher.applier.framework.command.power_state_command import \
|
||||||
PowerStateCommand
|
PowerStateCommand
|
||||||
from watcher.common.exception import ActionNotFound
|
from watcher.common.exception import ActionNotFound
|
||||||
from watcher.decision_engine.framework.default_planner import Primitives
|
from watcher.decision_engine.planner.default import Primitives
|
||||||
|
|
||||||
|
|
||||||
class DefaultCommandMapper(CommandMapper):
|
class DefaultCommandMapper(CommandMapper):
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ from watcher.applier.framework.messaging.trigger_action_plan import \
|
|||||||
TriggerActionPlan
|
TriggerActionPlan
|
||||||
from watcher.common.messaging.messaging_core import MessagingCore
|
from watcher.common.messaging.messaging_core import MessagingCore
|
||||||
from watcher.common.messaging.notification_handler import NotificationHandler
|
from watcher.common.messaging.notification_handler import NotificationHandler
|
||||||
from watcher.decision_engine.framework.messaging.events import Events
|
from watcher.decision_engine.messaging.events import Events
|
||||||
|
|
||||||
|
|
||||||
LOG = log.getLogger(__name__)
|
LOG = log.getLogger(__name__)
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ import sys
|
|||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
from watcher.common import service
|
from watcher.common import service
|
||||||
from watcher.decision_engine.framework.manager import DecisionEngineManager
|
from watcher.decision_engine.manager import DecisionEngineManager
|
||||||
|
|
||||||
from watcher import i18n
|
from watcher import i18n
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
from oslo_log import log
|
from oslo_log import log
|
||||||
|
|
||||||
from watcher.decision_engine.framework.messaging.events import Events
|
from watcher.decision_engine.messaging.events import Events
|
||||||
|
|
||||||
LOG = log.getLogger(__name__)
|
LOG = log.getLogger(__name__)
|
||||||
|
|
||||||
|
|||||||
@@ -16,12 +16,11 @@
|
|||||||
from oslo_log import log
|
from oslo_log import log
|
||||||
|
|
||||||
from watcher.common.messaging.events.event import Event
|
from watcher.common.messaging.events.event import Event
|
||||||
from watcher.decision_engine.api.messaging.decision_engine_command import \
|
from watcher.decision_engine.messaging.command.base import \
|
||||||
BaseDecisionEngineCommand
|
BaseDecisionEngineCommand
|
||||||
from watcher.decision_engine.framework.default_planner import DefaultPlanner
|
from watcher.decision_engine.messaging.events import Events
|
||||||
from watcher.decision_engine.framework.messaging.events import Events
|
from watcher.decision_engine.planner.default import DefaultPlanner
|
||||||
from watcher.decision_engine.framework.strategy.strategy_context import \
|
from watcher.decision_engine.strategy.context.default import StrategyContext
|
||||||
StrategyContext
|
|
||||||
from watcher.objects.audit import Audit
|
from watcher.objects.audit import Audit
|
||||||
from watcher.objects.audit import AuditStatus
|
from watcher.objects.audit import AuditStatus
|
||||||
from watcher.objects.audit_template import AuditTemplate
|
from watcher.objects.audit_template import AuditTemplate
|
||||||
@@ -21,19 +21,12 @@ from concurrent.futures import ThreadPoolExecutor
|
|||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
from oslo_log import log
|
from oslo_log import log
|
||||||
|
|
||||||
from watcher.decision_engine.framework.events.event_consumer_factory import \
|
from watcher.common.messaging.messaging_core import MessagingCore
|
||||||
EventConsumerFactory
|
from watcher.common.messaging.notification_handler import NotificationHandler
|
||||||
|
from watcher.decision_engine.event.consumer_factory import EventConsumerFactory
|
||||||
from watcher.common.messaging.messaging_core import \
|
from watcher.decision_engine.messaging.audit_endpoint import AuditEndpoint
|
||||||
MessagingCore
|
from watcher.decision_engine.messaging.events import Events
|
||||||
from watcher.decision_engine.framework.messaging.audit_endpoint import \
|
from watcher.decision_engine.strategy.context.default import StrategyContext
|
||||||
AuditEndpoint
|
|
||||||
from watcher.decision_engine.framework.messaging.events import Events
|
|
||||||
|
|
||||||
from watcher.common.messaging.notification_handler import \
|
|
||||||
NotificationHandler
|
|
||||||
from watcher.decision_engine.framework.strategy.strategy_context import \
|
|
||||||
StrategyContext
|
|
||||||
|
|
||||||
LOG = log.getLogger(__name__)
|
LOG = log.getLogger(__name__)
|
||||||
CONF = cfg.CONF
|
CONF = cfg.CONF
|
||||||
@@ -18,8 +18,7 @@
|
|||||||
#
|
#
|
||||||
from oslo_log import log
|
from oslo_log import log
|
||||||
|
|
||||||
from watcher.decision_engine.framework.command.trigger_audit_command import \
|
from watcher.decision_engine.command.audit import TriggerAuditCommand
|
||||||
TriggerAuditCommand
|
|
||||||
from watcher.metrics_engine.cluster_model_collector.manager import \
|
from watcher.metrics_engine.cluster_model_collector.manager import \
|
||||||
CollectorManager
|
CollectorManager
|
||||||
|
|
||||||
@@ -19,7 +19,7 @@
|
|||||||
import abc
|
import abc
|
||||||
import six
|
import six
|
||||||
|
|
||||||
from watcher.decision_engine.api.strategy.strategy import StrategyLevel
|
from watcher.decision_engine.strategy.level import StrategyLevel
|
||||||
|
|
||||||
|
|
||||||
@six.add_metaclass(abc.ABCMeta)
|
@six.add_metaclass(abc.ABCMeta)
|
||||||
@@ -16,9 +16,8 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
from watcher.decision_engine.api.strategy.meta_action import MetaAction
|
from watcher.decision_engine.meta_action.base import MetaAction
|
||||||
from watcher.decision_engine.framework.model.hypervisor_state import \
|
from watcher.decision_engine.model.hypervisor_state import HypervisorState
|
||||||
HypervisorState
|
|
||||||
|
|
||||||
|
|
||||||
class ChangeHypervisorState(MetaAction):
|
class ChangeHypervisorState(MetaAction):
|
||||||
@@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
from enum import Enum
|
from enum import Enum
|
||||||
|
|
||||||
from watcher.decision_engine.api.strategy.meta_action import MetaAction
|
from watcher.decision_engine.meta_action.base import MetaAction
|
||||||
|
|
||||||
|
|
||||||
class MigrationType(Enum):
|
class MigrationType(Enum):
|
||||||
@@ -16,7 +16,8 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
from watcher.decision_engine.api.strategy.meta_action import MetaAction
|
|
||||||
|
from watcher.decision_engine.meta_action.base import MetaAction
|
||||||
|
|
||||||
|
|
||||||
class Nop(MetaAction):
|
class Nop(MetaAction):
|
||||||
@@ -16,8 +16,8 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
from watcher.decision_engine.api.strategy.meta_action import MetaAction
|
from watcher.decision_engine.meta_action.base import MetaAction
|
||||||
from watcher.decision_engine.framework.model.power_state import PowerState
|
from watcher.decision_engine.model.power_state import PowerState
|
||||||
|
|
||||||
|
|
||||||
class ChangePowerState(MetaAction):
|
class ChangePowerState(MetaAction):
|
||||||
@@ -13,10 +13,9 @@
|
|||||||
# implied.
|
# implied.
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
from watcher.decision_engine.framework.model.hypervisor_state import \
|
from watcher.decision_engine.model.hypervisor_state import HypervisorState
|
||||||
HypervisorState
|
from watcher.decision_engine.model.named_element import NamedElement
|
||||||
from watcher.decision_engine.framework.model.named_element import NamedElement
|
from watcher.decision_engine.model.power_state import PowerState
|
||||||
from watcher.decision_engine.framework.model.power_state import PowerState
|
|
||||||
|
|
||||||
|
|
||||||
class Hypervisor(NamedElement):
|
class Hypervisor(NamedElement):
|
||||||
@@ -18,9 +18,9 @@ from oslo_log import log
|
|||||||
from watcher.common.exception import HypervisorNotFound
|
from watcher.common.exception import HypervisorNotFound
|
||||||
from watcher.common.exception import IllegalArgumentException
|
from watcher.common.exception import IllegalArgumentException
|
||||||
from watcher.common.exception import VMNotFound
|
from watcher.common.exception import VMNotFound
|
||||||
from watcher.decision_engine.framework.model.hypervisor import Hypervisor
|
from watcher.decision_engine.model.hypervisor import Hypervisor
|
||||||
from watcher.decision_engine.framework.model.mapping import Mapping
|
from watcher.decision_engine.model.mapping import Mapping
|
||||||
from watcher.decision_engine.framework.model.vm import VM
|
from watcher.decision_engine.model.vm import VM
|
||||||
|
|
||||||
LOG = log.getLogger(__name__)
|
LOG = log.getLogger(__name__)
|
||||||
|
|
||||||
@@ -13,8 +13,8 @@
|
|||||||
# implied.
|
# implied.
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
from watcher.decision_engine.framework.model.named_element import NamedElement
|
from watcher.decision_engine.model.named_element import NamedElement
|
||||||
from watcher.decision_engine.framework.model.vm_state import VMState
|
from watcher.decision_engine.model.vm_state import VMState
|
||||||
|
|
||||||
|
|
||||||
class VM(NamedElement):
|
class VM(NamedElement):
|
||||||
@@ -21,16 +21,15 @@ from oslo_log import log
|
|||||||
from enum import Enum
|
from enum import Enum
|
||||||
from watcher.common.exception import MetaActionNotFound
|
from watcher.common.exception import MetaActionNotFound
|
||||||
from watcher.common import utils
|
from watcher.common import utils
|
||||||
from watcher.decision_engine.api.planner.planner import Planner
|
from watcher.decision_engine.planner.base import Planner
|
||||||
|
|
||||||
from watcher import objects
|
from watcher import objects
|
||||||
|
|
||||||
from watcher.decision_engine.framework.meta_actions.hypervisor_state import \
|
from watcher.decision_engine.meta_action.hypervisor_state import \
|
||||||
ChangeHypervisorState
|
ChangeHypervisorState
|
||||||
from watcher.decision_engine.framework.meta_actions.migrate import Migrate
|
from watcher.decision_engine.meta_action.migrate import Migrate
|
||||||
from watcher.decision_engine.framework.meta_actions.nop import Nop
|
from watcher.decision_engine.meta_action.nop import Nop
|
||||||
from watcher.decision_engine.framework.meta_actions.power_state import \
|
from watcher.decision_engine.meta_action.power_state import ChangePowerState
|
||||||
ChangePowerState
|
|
||||||
from watcher.objects.action import Status as AStatus
|
from watcher.objects.action import Status as AStatus
|
||||||
from watcher.objects.action_plan import Status as APStatus
|
from watcher.objects.action_plan import Status as APStatus
|
||||||
|
|
||||||
@@ -30,14 +30,11 @@ from watcher.common.messaging.messaging_core import MessagingCore
|
|||||||
from watcher.common.messaging.notification_handler import NotificationHandler
|
from watcher.common.messaging.notification_handler import NotificationHandler
|
||||||
from watcher.common.messaging.utils.transport_url_builder import \
|
from watcher.common.messaging.utils.transport_url_builder import \
|
||||||
TransportUrlBuilder
|
TransportUrlBuilder
|
||||||
from watcher.decision_engine.framework.events.event_consumer_factory import \
|
from watcher.decision_engine.event.consumer_factory import EventConsumerFactory
|
||||||
EventConsumerFactory
|
from watcher.decision_engine.manager import decision_engine_opt_group
|
||||||
from watcher.decision_engine.framework.manager import \
|
from watcher.decision_engine.manager import WATCHER_DECISION_ENGINE_OPTS
|
||||||
decision_engine_opt_group
|
|
||||||
from watcher.decision_engine.framework.manager import \
|
|
||||||
WATCHER_DECISION_ENGINE_OPTS
|
|
||||||
|
|
||||||
from watcher.decision_engine.framework.messaging.events import Events
|
from watcher.decision_engine.messaging.events import Events
|
||||||
|
|
||||||
LOG = log.getLogger(__name__)
|
LOG = log.getLogger(__name__)
|
||||||
CONF = cfg.CONF
|
CONF = cfg.CONF
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
from oslo_log import log
|
from oslo_log import log
|
||||||
from watcher.decision_engine.api.solution.solution import Solution
|
from watcher.decision_engine.solution.base import Solution
|
||||||
|
|
||||||
LOG = log.getLogger(__name__)
|
LOG = log.getLogger(__name__)
|
||||||
|
|
||||||
@@ -18,8 +18,8 @@ import abc
|
|||||||
from oslo_log import log
|
from oslo_log import log
|
||||||
|
|
||||||
import six
|
import six
|
||||||
from watcher.decision_engine.api.strategy.strategy_level import StrategyLevel
|
from watcher.decision_engine.solution.default import DefaultSolution
|
||||||
from watcher.decision_engine.framework.default_solution import DefaultSolution
|
from watcher.decision_engine.strategy.level import StrategyLevel
|
||||||
|
|
||||||
|
|
||||||
LOG = log.getLogger(__name__)
|
LOG = log.getLogger(__name__)
|
||||||
@@ -20,22 +20,18 @@ from oslo_log import log
|
|||||||
|
|
||||||
from watcher.common.exception import ClusterEmpty
|
from watcher.common.exception import ClusterEmpty
|
||||||
from watcher.common.exception import ClusteStateNotDefined
|
from watcher.common.exception import ClusteStateNotDefined
|
||||||
from watcher.decision_engine.api.strategy.strategy import BaseStrategy
|
from watcher.decision_engine.strategy.base import BaseStrategy
|
||||||
from watcher.decision_engine.api.strategy.strategy import StrategyLevel
|
from watcher.decision_engine.strategy.level import StrategyLevel
|
||||||
|
|
||||||
from watcher.decision_engine.framework.meta_actions.hypervisor_state import \
|
from watcher.decision_engine.meta_action.hypervisor_state import \
|
||||||
ChangeHypervisorState
|
ChangeHypervisorState
|
||||||
from watcher.decision_engine.framework.meta_actions.migrate import Migrate
|
from watcher.decision_engine.meta_action.migrate import Migrate
|
||||||
from watcher.decision_engine.framework.meta_actions.migrate import \
|
from watcher.decision_engine.meta_action.migrate import MigrationType
|
||||||
MigrationType
|
from watcher.decision_engine.meta_action.power_state import ChangePowerState
|
||||||
from watcher.decision_engine.framework.meta_actions.power_state import \
|
from watcher.decision_engine.meta_action.power_state import PowerState
|
||||||
ChangePowerState
|
from watcher.decision_engine.model.hypervisor_state import HypervisorState
|
||||||
from watcher.decision_engine.framework.meta_actions.power_state import \
|
from watcher.decision_engine.model.resource import ResourceType
|
||||||
PowerState
|
from watcher.decision_engine.model.vm_state import VMState
|
||||||
from watcher.decision_engine.framework.model.hypervisor_state import \
|
|
||||||
HypervisorState
|
|
||||||
from watcher.decision_engine.framework.model.resource import ResourceType
|
|
||||||
from watcher.decision_engine.framework.model.vm_state import VMState
|
|
||||||
from watcher.metrics_engine.cluster_history.ceilometer import \
|
from watcher.metrics_engine.cluster_history.ceilometer import \
|
||||||
CeilometerClusterHistory
|
CeilometerClusterHistory
|
||||||
|
|
||||||
@@ -15,11 +15,9 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
from oslo_log import log
|
from oslo_log import log
|
||||||
|
|
||||||
from watcher.decision_engine.api.strategy.strategy_context import\
|
from watcher.decision_engine.planner.default import DefaultPlanner
|
||||||
BaseStrategyContext
|
from watcher.decision_engine.strategy.context.base import BaseStrategyContext
|
||||||
from watcher.decision_engine.framework.default_planner import DefaultPlanner
|
from watcher.decision_engine.strategy.selector.default import StrategySelector
|
||||||
from watcher.decision_engine.framework.strategy.strategy_selector import \
|
|
||||||
StrategySelector
|
|
||||||
|
|
||||||
LOG = log.getLogger(__name__)
|
LOG = log.getLogger(__name__)
|
||||||
|
|
||||||
@@ -18,8 +18,8 @@
|
|||||||
#
|
#
|
||||||
from oslo_log import log
|
from oslo_log import log
|
||||||
|
|
||||||
from watcher.decision_engine.api.strategy.strategy import BaseStrategy
|
from watcher.decision_engine.meta_action.nop import Nop
|
||||||
from watcher.decision_engine.framework.meta_actions.nop import Nop
|
from watcher.decision_engine.strategy.base import BaseStrategy
|
||||||
|
|
||||||
LOG = log.getLogger(__name__)
|
LOG = log.getLogger(__name__)
|
||||||
|
|
||||||
@@ -21,7 +21,7 @@ from __future__ import unicode_literals
|
|||||||
|
|
||||||
from oslo_log import log
|
from oslo_log import log
|
||||||
from stevedore import ExtensionManager
|
from stevedore import ExtensionManager
|
||||||
from watcher.decision_engine.strategies.basic_consolidation import \
|
from watcher.decision_engine.strategy.basic_consolidation import \
|
||||||
BasicConsolidation
|
BasicConsolidation
|
||||||
|
|
||||||
LOG = log.getLogger(__name__)
|
LOG = log.getLogger(__name__)
|
||||||
@@ -16,9 +16,8 @@
|
|||||||
|
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
from oslo_log import log
|
from oslo_log import log
|
||||||
from watcher.decision_engine.api.strategy.selector import Selector
|
from watcher.decision_engine.strategy.loader import StrategyLoader
|
||||||
from watcher.decision_engine.framework.strategy.strategy_loader import \
|
from watcher.decision_engine.strategy.selector.base import Selector
|
||||||
StrategyLoader
|
|
||||||
from watcher.objects.audit_template import Goal
|
from watcher.objects.audit_template import Goal
|
||||||
|
|
||||||
LOG = log.getLogger(__name__)
|
LOG = log.getLogger(__name__)
|
||||||
@@ -21,11 +21,11 @@
|
|||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
from oslo_log import log
|
from oslo_log import log
|
||||||
|
|
||||||
from watcher.decision_engine.framework.model.hypervisor import Hypervisor
|
from watcher.decision_engine.model.hypervisor import Hypervisor
|
||||||
from watcher.decision_engine.framework.model.model_root import ModelRoot
|
from watcher.decision_engine.model.model_root import ModelRoot
|
||||||
from watcher.decision_engine.framework.model.resource import Resource
|
from watcher.decision_engine.model.resource import Resource
|
||||||
from watcher.decision_engine.framework.model.resource import ResourceType
|
from watcher.decision_engine.model.resource import ResourceType
|
||||||
from watcher.decision_engine.framework.model.vm import VM
|
from watcher.decision_engine.model.vm import VM
|
||||||
from watcher.metrics_engine.cluster_model_collector.api import \
|
from watcher.metrics_engine.cluster_model_collector.api import \
|
||||||
BaseClusterModelCollector
|
BaseClusterModelCollector
|
||||||
|
|
||||||
|
|||||||
@@ -22,8 +22,9 @@ import watcher.api.app
|
|||||||
from watcher.applier.framework import manager_applier
|
from watcher.applier.framework import manager_applier
|
||||||
import watcher.common.messaging.messaging_core
|
import watcher.common.messaging.messaging_core
|
||||||
|
|
||||||
from watcher.decision_engine.framework import manager
|
from watcher.decision_engine import manager
|
||||||
from watcher.decision_engine.framework.strategy import strategy_selector
|
from watcher.decision_engine.strategy.selector import default \
|
||||||
|
as strategy_selector
|
||||||
|
|
||||||
|
|
||||||
def list_opts():
|
def list_opts():
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ from six.moves.urllib import parse as urlparse
|
|||||||
from watcher.api.controllers.v1 import audit as api_audit
|
from watcher.api.controllers.v1 import audit as api_audit
|
||||||
from watcher.common import utils
|
from watcher.common import utils
|
||||||
from watcher.db import api as db_api
|
from watcher.db import api as db_api
|
||||||
from watcher.decision_engine.framework import rpcapi as deapi
|
from watcher.decision_engine import rpcapi as deapi
|
||||||
from watcher import objects
|
from watcher import objects
|
||||||
from watcher.tests.api import base as api_base
|
from watcher.tests.api import base as api_base
|
||||||
from watcher.tests.api import utils as api_utils
|
from watcher.tests.api import utils as api_utils
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ from watcher.applier.framework.command_executor import CommandExecutor
|
|||||||
from watcher import objects
|
from watcher import objects
|
||||||
|
|
||||||
from watcher.common import utils
|
from watcher.common import utils
|
||||||
from watcher.decision_engine.framework.default_planner import Primitives
|
from watcher.decision_engine.planner.default import Primitives
|
||||||
from watcher.objects.action import Action
|
from watcher.objects.action import Action
|
||||||
from watcher.objects.action import Status
|
from watcher.objects.action import Status
|
||||||
from watcher.tests.db.base import DbTestCase
|
from watcher.tests.db.base import DbTestCase
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
import mock
|
import mock
|
||||||
from watcher.applier.framework.default_command_mapper import \
|
from watcher.applier.framework.default_command_mapper import \
|
||||||
DefaultCommandMapper
|
DefaultCommandMapper
|
||||||
from watcher.decision_engine.framework.default_planner import Primitives
|
from watcher.decision_engine.planner.default import Primitives
|
||||||
from watcher.tests import base
|
from watcher.tests import base
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ import types
|
|||||||
|
|
||||||
from mock import patch
|
from mock import patch
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
from watcher.decision_engine.framework.manager import DecisionEngineManager
|
from watcher.decision_engine.manager import DecisionEngineManager
|
||||||
from watcher.tests.base import BaseTestCase
|
from watcher.tests.base import BaseTestCase
|
||||||
|
|
||||||
from watcher.cmd import decisionengine
|
from watcher.cmd import decisionengine
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ from mock import call
|
|||||||
from mock import MagicMock
|
from mock import MagicMock
|
||||||
from watcher.common.messaging.events.event import Event
|
from watcher.common.messaging.events.event import Event
|
||||||
from watcher.common.messaging.events.event_dispatcher import EventDispatcher
|
from watcher.common.messaging.events.event_dispatcher import EventDispatcher
|
||||||
from watcher.decision_engine.framework.messaging.events import Events
|
from watcher.decision_engine.messaging.events import Events
|
||||||
from watcher.tests import base
|
from watcher.tests import base
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -16,9 +16,8 @@
|
|||||||
|
|
||||||
import exceptions
|
import exceptions
|
||||||
|
|
||||||
from watcher.decision_engine.framework.events.event_consumer_factory import \
|
from watcher.decision_engine.event.consumer_factory import EventConsumerFactory
|
||||||
EventConsumerFactory
|
from watcher.decision_engine.messaging.events import Events
|
||||||
from watcher.decision_engine.framework.messaging.events import Events
|
|
||||||
from watcher.tests import base
|
from watcher.tests import base
|
||||||
|
|
||||||
|
|
||||||
@@ -16,9 +16,8 @@
|
|||||||
|
|
||||||
from mock import call
|
from mock import call
|
||||||
from mock import MagicMock
|
from mock import MagicMock
|
||||||
from watcher.decision_engine.framework.command.trigger_audit_command import \
|
from watcher.decision_engine.command.audit import TriggerAuditCommand
|
||||||
TriggerAuditCommand
|
from watcher.decision_engine.messaging.events import Events
|
||||||
from watcher.decision_engine.framework.messaging.events import Events
|
|
||||||
from watcher.objects.audit import Audit
|
from watcher.objects.audit import Audit
|
||||||
from watcher.objects.audit import AuditStatus
|
from watcher.objects.audit import AuditStatus
|
||||||
from watcher.tests.db.base import DbTestCase
|
from watcher.tests.db.base import DbTestCase
|
||||||
@@ -19,11 +19,11 @@
|
|||||||
|
|
||||||
import random
|
import random
|
||||||
|
|
||||||
from watcher.decision_engine.framework.model.hypervisor import Hypervisor
|
from watcher.decision_engine.model.hypervisor import Hypervisor
|
||||||
from watcher.decision_engine.framework.model.model_root import ModelRoot
|
from watcher.decision_engine.model.model_root import ModelRoot
|
||||||
from watcher.decision_engine.framework.model.resource import Resource
|
from watcher.decision_engine.model.resource import Resource
|
||||||
from watcher.decision_engine.framework.model.resource import ResourceType
|
from watcher.decision_engine.model.resource import ResourceType
|
||||||
from watcher.decision_engine.framework.model.vm import VM
|
from watcher.decision_engine.model.vm import VM
|
||||||
from watcher.metrics_engine.cluster_model_collector.api import \
|
from watcher.metrics_engine.cluster_model_collector.api import \
|
||||||
BaseClusterModelCollector
|
BaseClusterModelCollector
|
||||||
|
|
||||||
|
|||||||
@@ -17,10 +17,8 @@ import mock
|
|||||||
from mock import MagicMock
|
from mock import MagicMock
|
||||||
|
|
||||||
from watcher.common import utils
|
from watcher.common import utils
|
||||||
from watcher.decision_engine.framework.command.trigger_audit_command import \
|
from watcher.decision_engine.command.audit import TriggerAuditCommand
|
||||||
TriggerAuditCommand
|
from watcher.decision_engine.messaging.audit_endpoint import AuditEndpoint
|
||||||
from watcher.decision_engine.framework.messaging.audit_endpoint import \
|
|
||||||
AuditEndpoint
|
|
||||||
from watcher.metrics_engine.cluster_model_collector.manager import \
|
from watcher.metrics_engine.cluster_model_collector.manager import \
|
||||||
CollectorManager
|
CollectorManager
|
||||||
from watcher.tests import base
|
from watcher.tests import base
|
||||||
@@ -16,9 +16,9 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
from watcher.decision_engine.framework.meta_actions.migrate import Migrate
|
from watcher.decision_engine.meta_action.migrate import Migrate
|
||||||
from watcher.decision_engine.framework.model.hypervisor import Hypervisor
|
from watcher.decision_engine.model.hypervisor import Hypervisor
|
||||||
from watcher.decision_engine.framework.model.vm import VM
|
from watcher.decision_engine.model.vm import VM
|
||||||
from watcher.tests import base
|
from watcher.tests import base
|
||||||
|
|
||||||
|
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
|
|
||||||
from watcher.decision_engine.framework.model.diskInfo import DiskInfo
|
from watcher.decision_engine.model.diskInfo import DiskInfo
|
||||||
from watcher.tests import base
|
from watcher.tests import base
|
||||||
|
|
||||||
|
|
||||||
@@ -17,8 +17,8 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
import uuid
|
import uuid
|
||||||
from watcher.decision_engine.framework.model.hypervisor import Hypervisor
|
from watcher.decision_engine.model.hypervisor import Hypervisor
|
||||||
from watcher.decision_engine.framework.model.vm_state import VMState
|
from watcher.decision_engine.model.vm_state import VMState
|
||||||
from watcher.tests import base
|
from watcher.tests import base
|
||||||
from watcher.tests.decision_engine.faker_cluster_state import \
|
from watcher.tests.decision_engine.faker_cluster_state import \
|
||||||
FakerModelCollector
|
FakerModelCollector
|
||||||
@@ -19,10 +19,9 @@
|
|||||||
import uuid
|
import uuid
|
||||||
from watcher.common import exception
|
from watcher.common import exception
|
||||||
from watcher.common.exception import IllegalArgumentException
|
from watcher.common.exception import IllegalArgumentException
|
||||||
from watcher.decision_engine.framework.model.hypervisor import Hypervisor
|
from watcher.decision_engine.model.hypervisor import Hypervisor
|
||||||
from watcher.decision_engine.framework.model.hypervisor_state import \
|
from watcher.decision_engine.model.hypervisor_state import HypervisorState
|
||||||
HypervisorState
|
from watcher.decision_engine.model.model_root import ModelRoot
|
||||||
from watcher.decision_engine.framework.model.model_root import ModelRoot
|
|
||||||
from watcher.tests.decision_engine.faker_cluster_state import \
|
from watcher.tests.decision_engine.faker_cluster_state import \
|
||||||
FakerModelCollector
|
FakerModelCollector
|
||||||
|
|
||||||
@@ -16,7 +16,7 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
from watcher.decision_engine.framework.model.named_element import NamedElement
|
from watcher.decision_engine.model.named_element import NamedElement
|
||||||
from watcher.tests import base
|
from watcher.tests import base
|
||||||
|
|
||||||
|
|
||||||
@@ -16,8 +16,8 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
from watcher.decision_engine.framework.model.vm import VM
|
from watcher.decision_engine.model.vm import VM
|
||||||
from watcher.decision_engine.framework.model.vm_state import VMState
|
from watcher.decision_engine.model.vm_state import VMState
|
||||||
from watcher.tests import base
|
from watcher.tests import base
|
||||||
|
|
||||||
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
__author__ = 'Jean-Emile DARTOIS <jean-emile.dartois@b-com.com>'
|
|
||||||
@@ -14,8 +14,7 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
from watcher.decision_engine.framework.strategy.strategy_context import \
|
from watcher.decision_engine.strategy.context.default import StrategyContext
|
||||||
StrategyContext
|
|
||||||
from watcher.tests import base
|
from watcher.tests import base
|
||||||
|
|
||||||
|
|
||||||
@@ -15,10 +15,8 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
import mock
|
import mock
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
from watcher.decision_engine.framework.strategy.strategy_loader import \
|
from watcher.decision_engine.strategy.loader import StrategyLoader
|
||||||
StrategyLoader
|
from watcher.decision_engine.strategy.selector.default import StrategySelector
|
||||||
from watcher.decision_engine.framework.strategy.strategy_selector import \
|
|
||||||
StrategySelector
|
|
||||||
from watcher.objects.audit_template import Goal
|
from watcher.objects.audit_template import Goal
|
||||||
from watcher.tests import base
|
from watcher.tests import base
|
||||||
|
|
||||||
@@ -13,9 +13,8 @@
|
|||||||
# implied.
|
# implied.
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
from watcher.decision_engine.api.strategy.strategy import BaseStrategy
|
from watcher.decision_engine.strategy.base import BaseStrategy
|
||||||
from watcher.decision_engine.framework.strategy.strategy_loader import \
|
from watcher.decision_engine.strategy.loader import StrategyLoader
|
||||||
StrategyLoader
|
|
||||||
from watcher.tests import base
|
from watcher.tests import base
|
||||||
|
|
||||||
|
|
||||||
@@ -23,14 +23,13 @@ from mock import MagicMock
|
|||||||
|
|
||||||
from watcher.common import exception
|
from watcher.common import exception
|
||||||
|
|
||||||
from watcher.decision_engine.framework.meta_actions.hypervisor_state import \
|
from watcher.decision_engine.meta_action.hypervisor_state import \
|
||||||
ChangeHypervisorState
|
ChangeHypervisorState
|
||||||
from watcher.decision_engine.framework.meta_actions.power_state import \
|
from watcher.decision_engine.meta_action.power_state import ChangePowerState
|
||||||
ChangePowerState
|
|
||||||
|
|
||||||
from watcher.decision_engine.framework.meta_actions.migrate import Migrate
|
from watcher.decision_engine.meta_action.migrate import Migrate
|
||||||
from watcher.decision_engine.framework.model.model_root import ModelRoot
|
from watcher.decision_engine.model.model_root import ModelRoot
|
||||||
from watcher.decision_engine.strategies.basic_consolidation import \
|
from watcher.decision_engine.strategy.basic_consolidation import \
|
||||||
BasicConsolidation
|
BasicConsolidation
|
||||||
from watcher.tests import base
|
from watcher.tests import base
|
||||||
from watcher.tests.decision_engine.faker_cluster_state import \
|
from watcher.tests.decision_engine.faker_cluster_state import \
|
||||||
@@ -19,8 +19,8 @@ from mock import MagicMock
|
|||||||
from watcher.common.exception import MetaActionNotFound
|
from watcher.common.exception import MetaActionNotFound
|
||||||
from watcher.common import utils
|
from watcher.common import utils
|
||||||
from watcher.db import api as db_api
|
from watcher.db import api as db_api
|
||||||
from watcher.decision_engine.framework.default_planner import DefaultPlanner
|
from watcher.decision_engine.planner.default import DefaultPlanner
|
||||||
from watcher.decision_engine.strategies.basic_consolidation import \
|
from watcher.decision_engine.strategy.basic_consolidation import \
|
||||||
BasicConsolidation
|
BasicConsolidation
|
||||||
|
|
||||||
from watcher.tests.db import base
|
from watcher.tests.db import base
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
# implied.
|
# implied.
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
from watcher.decision_engine.framework.default_solution import DefaultSolution
|
from watcher.decision_engine.solution.default import DefaultSolution
|
||||||
from watcher.tests import base
|
from watcher.tests import base
|
||||||
|
|
||||||
|
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
# implied.
|
# implied.
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
from watcher.decision_engine.strategies.dummy_strategy import DummyStrategy
|
from watcher.decision_engine.strategy.dummy_strategy import DummyStrategy
|
||||||
from watcher.tests import base
|
from watcher.tests import base
|
||||||
from watcher.tests.decision_engine.faker_cluster_state import \
|
from watcher.tests.decision_engine.faker_cluster_state import \
|
||||||
FakerModelCollector
|
FakerModelCollector
|
||||||
@@ -18,14 +18,12 @@ import mock
|
|||||||
|
|
||||||
from watcher.common import utils
|
from watcher.common import utils
|
||||||
|
|
||||||
from watcher.decision_engine.framework.events.event_consumer_factory import \
|
from watcher.decision_engine.event.consumer_factory import EventConsumerFactory
|
||||||
EventConsumerFactory
|
|
||||||
|
|
||||||
from watcher.common.messaging.events.event import Event
|
from watcher.common.messaging.events.event import Event
|
||||||
from watcher.decision_engine.framework.manager import \
|
from watcher.decision_engine.manager import DecisionEngineManager
|
||||||
DecisionEngineManager
|
|
||||||
|
|
||||||
from watcher.decision_engine.framework.messaging.events import Events
|
from watcher.decision_engine.messaging.events import Events
|
||||||
from watcher.tests import base
|
from watcher.tests import base
|
||||||
|
|
||||||
|
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
from watcher.decision_engine.api.strategy.meta_action import MetaAction
|
from watcher.decision_engine.meta_action.base import MetaAction
|
||||||
from watcher.tests import base
|
from watcher.tests import base
|
||||||
|
|
||||||
|
|
||||||
@@ -18,7 +18,7 @@ import mock
|
|||||||
import oslo_messaging as om
|
import oslo_messaging as om
|
||||||
from watcher.common import exception
|
from watcher.common import exception
|
||||||
from watcher.common import utils
|
from watcher.common import utils
|
||||||
from watcher.decision_engine.framework.rpcapi import DecisionEngineAPI
|
from watcher.decision_engine.rpcapi import DecisionEngineAPI
|
||||||
from watcher.tests import base
|
from watcher.tests import base
|
||||||
|
|
||||||
|
|
||||||
@@ -19,16 +19,14 @@ from __future__ import unicode_literals
|
|||||||
from mock import patch
|
from mock import patch
|
||||||
from stevedore.extension import Extension
|
from stevedore.extension import Extension
|
||||||
from stevedore.extension import ExtensionManager
|
from stevedore.extension import ExtensionManager
|
||||||
from watcher.decision_engine.framework.strategy.strategy_loader import \
|
from watcher.decision_engine.strategy.dummy_strategy import DummyStrategy
|
||||||
StrategyLoader
|
from watcher.decision_engine.strategy.loader import StrategyLoader
|
||||||
from watcher.decision_engine.strategies.dummy_strategy import DummyStrategy
|
|
||||||
from watcher.tests import base
|
from watcher.tests import base
|
||||||
|
|
||||||
|
|
||||||
class TestLoader(base.BaseTestCase):
|
class TestLoader(base.BaseTestCase):
|
||||||
|
|
||||||
@patch("watcher.decision_engine.framework.strategy."
|
@patch("watcher.decision_engine.strategy.loader.ExtensionManager")
|
||||||
"strategy_loader.ExtensionManager")
|
|
||||||
def test_strategy_loader(self, m_extension_manager):
|
def test_strategy_loader(self, m_extension_manager):
|
||||||
dummy_strategy_name = "dummy"
|
dummy_strategy_name = "dummy"
|
||||||
m_extension_manager.return_value = ExtensionManager.make_test_instance(
|
m_extension_manager.return_value = ExtensionManager.make_test_instance(
|
||||||
|
|||||||
Reference in New Issue
Block a user