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:
@@ -16,12 +16,11 @@
|
||||
from oslo_log import log
|
||||
|
||||
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
|
||||
from watcher.decision_engine.framework.default_planner import DefaultPlanner
|
||||
from watcher.decision_engine.framework.messaging.events import Events
|
||||
from watcher.decision_engine.framework.strategy.strategy_context import \
|
||||
StrategyContext
|
||||
from watcher.decision_engine.messaging.events import Events
|
||||
from watcher.decision_engine.planner.default import DefaultPlanner
|
||||
from watcher.decision_engine.strategy.context.default import StrategyContext
|
||||
from watcher.objects.audit import Audit
|
||||
from watcher.objects.audit import AuditStatus
|
||||
from watcher.objects.audit_template import AuditTemplate
|
||||
@@ -21,19 +21,12 @@ from concurrent.futures import ThreadPoolExecutor
|
||||
from oslo_config import cfg
|
||||
from oslo_log import log
|
||||
|
||||
from watcher.decision_engine.framework.events.event_consumer_factory import \
|
||||
EventConsumerFactory
|
||||
|
||||
from watcher.common.messaging.messaging_core import \
|
||||
MessagingCore
|
||||
from watcher.decision_engine.framework.messaging.audit_endpoint import \
|
||||
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
|
||||
from watcher.common.messaging.messaging_core import MessagingCore
|
||||
from watcher.common.messaging.notification_handler import NotificationHandler
|
||||
from watcher.decision_engine.event.consumer_factory import EventConsumerFactory
|
||||
from watcher.decision_engine.messaging.audit_endpoint import AuditEndpoint
|
||||
from watcher.decision_engine.messaging.events import Events
|
||||
from watcher.decision_engine.strategy.context.default import StrategyContext
|
||||
|
||||
LOG = log.getLogger(__name__)
|
||||
CONF = cfg.CONF
|
||||
@@ -18,8 +18,7 @@
|
||||
#
|
||||
from oslo_log import log
|
||||
|
||||
from watcher.decision_engine.framework.command.trigger_audit_command import \
|
||||
TriggerAuditCommand
|
||||
from watcher.decision_engine.command.audit import TriggerAuditCommand
|
||||
from watcher.metrics_engine.cluster_model_collector.manager import \
|
||||
CollectorManager
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
import abc
|
||||
import six
|
||||
|
||||
from watcher.decision_engine.api.strategy.strategy import StrategyLevel
|
||||
from watcher.decision_engine.strategy.level import StrategyLevel
|
||||
|
||||
|
||||
@six.add_metaclass(abc.ABCMeta)
|
||||
@@ -16,9 +16,8 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
from watcher.decision_engine.api.strategy.meta_action import MetaAction
|
||||
from watcher.decision_engine.framework.model.hypervisor_state import \
|
||||
HypervisorState
|
||||
from watcher.decision_engine.meta_action.base import MetaAction
|
||||
from watcher.decision_engine.model.hypervisor_state import HypervisorState
|
||||
|
||||
|
||||
class ChangeHypervisorState(MetaAction):
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
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):
|
||||
@@ -16,7 +16,8 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# 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):
|
||||
@@ -16,8 +16,8 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
from watcher.decision_engine.api.strategy.meta_action import MetaAction
|
||||
from watcher.decision_engine.framework.model.power_state import PowerState
|
||||
from watcher.decision_engine.meta_action.base import MetaAction
|
||||
from watcher.decision_engine.model.power_state import PowerState
|
||||
|
||||
|
||||
class ChangePowerState(MetaAction):
|
||||
@@ -13,10 +13,9 @@
|
||||
# implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
from watcher.decision_engine.framework.model.hypervisor_state import \
|
||||
HypervisorState
|
||||
from watcher.decision_engine.framework.model.named_element import NamedElement
|
||||
from watcher.decision_engine.framework.model.power_state import PowerState
|
||||
from watcher.decision_engine.model.hypervisor_state import HypervisorState
|
||||
from watcher.decision_engine.model.named_element import NamedElement
|
||||
from watcher.decision_engine.model.power_state import PowerState
|
||||
|
||||
|
||||
class Hypervisor(NamedElement):
|
||||
@@ -18,9 +18,9 @@ from oslo_log import log
|
||||
from watcher.common.exception import HypervisorNotFound
|
||||
from watcher.common.exception import IllegalArgumentException
|
||||
from watcher.common.exception import VMNotFound
|
||||
from watcher.decision_engine.framework.model.hypervisor import Hypervisor
|
||||
from watcher.decision_engine.framework.model.mapping import Mapping
|
||||
from watcher.decision_engine.framework.model.vm import VM
|
||||
from watcher.decision_engine.model.hypervisor import Hypervisor
|
||||
from watcher.decision_engine.model.mapping import Mapping
|
||||
from watcher.decision_engine.model.vm import VM
|
||||
|
||||
LOG = log.getLogger(__name__)
|
||||
|
||||
@@ -13,8 +13,8 @@
|
||||
# implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
from watcher.decision_engine.framework.model.named_element import NamedElement
|
||||
from watcher.decision_engine.framework.model.vm_state import VMState
|
||||
from watcher.decision_engine.model.named_element import NamedElement
|
||||
from watcher.decision_engine.model.vm_state import VMState
|
||||
|
||||
|
||||
class VM(NamedElement):
|
||||
@@ -21,16 +21,15 @@ from oslo_log import log
|
||||
from enum import Enum
|
||||
from watcher.common.exception import MetaActionNotFound
|
||||
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.decision_engine.framework.meta_actions.hypervisor_state import \
|
||||
from watcher.decision_engine.meta_action.hypervisor_state import \
|
||||
ChangeHypervisorState
|
||||
from watcher.decision_engine.framework.meta_actions.migrate import Migrate
|
||||
from watcher.decision_engine.framework.meta_actions.nop import Nop
|
||||
from watcher.decision_engine.framework.meta_actions.power_state import \
|
||||
ChangePowerState
|
||||
from watcher.decision_engine.meta_action.migrate import Migrate
|
||||
from watcher.decision_engine.meta_action.nop import Nop
|
||||
from watcher.decision_engine.meta_action.power_state import ChangePowerState
|
||||
from watcher.objects.action import Status as AStatus
|
||||
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.utils.transport_url_builder import \
|
||||
TransportUrlBuilder
|
||||
from watcher.decision_engine.framework.events.event_consumer_factory import \
|
||||
EventConsumerFactory
|
||||
from watcher.decision_engine.framework.manager import \
|
||||
decision_engine_opt_group
|
||||
from watcher.decision_engine.framework.manager import \
|
||||
WATCHER_DECISION_ENGINE_OPTS
|
||||
from watcher.decision_engine.event.consumer_factory import EventConsumerFactory
|
||||
from watcher.decision_engine.manager import decision_engine_opt_group
|
||||
from watcher.decision_engine.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__)
|
||||
CONF = cfg.CONF
|
||||
@@ -17,7 +17,7 @@
|
||||
# limitations under the License.
|
||||
#
|
||||
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__)
|
||||
|
||||
@@ -18,8 +18,8 @@ import abc
|
||||
from oslo_log import log
|
||||
|
||||
import six
|
||||
from watcher.decision_engine.api.strategy.strategy_level import StrategyLevel
|
||||
from watcher.decision_engine.framework.default_solution import DefaultSolution
|
||||
from watcher.decision_engine.solution.default import DefaultSolution
|
||||
from watcher.decision_engine.strategy.level import StrategyLevel
|
||||
|
||||
|
||||
LOG = log.getLogger(__name__)
|
||||
@@ -20,22 +20,18 @@ from oslo_log import log
|
||||
|
||||
from watcher.common.exception import ClusterEmpty
|
||||
from watcher.common.exception import ClusteStateNotDefined
|
||||
from watcher.decision_engine.api.strategy.strategy import BaseStrategy
|
||||
from watcher.decision_engine.api.strategy.strategy import StrategyLevel
|
||||
from watcher.decision_engine.strategy.base import BaseStrategy
|
||||
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
|
||||
from watcher.decision_engine.framework.meta_actions.migrate import Migrate
|
||||
from watcher.decision_engine.framework.meta_actions.migrate import \
|
||||
MigrationType
|
||||
from watcher.decision_engine.framework.meta_actions.power_state import \
|
||||
ChangePowerState
|
||||
from watcher.decision_engine.framework.meta_actions.power_state import \
|
||||
PowerState
|
||||
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.decision_engine.meta_action.migrate import Migrate
|
||||
from watcher.decision_engine.meta_action.migrate import MigrationType
|
||||
from watcher.decision_engine.meta_action.power_state import ChangePowerState
|
||||
from watcher.decision_engine.meta_action.power_state import PowerState
|
||||
from watcher.decision_engine.model.hypervisor_state import HypervisorState
|
||||
from watcher.decision_engine.model.resource import ResourceType
|
||||
from watcher.decision_engine.model.vm_state import VMState
|
||||
from watcher.metrics_engine.cluster_history.ceilometer import \
|
||||
CeilometerClusterHistory
|
||||
|
||||
@@ -15,11 +15,9 @@
|
||||
# limitations under the License.
|
||||
from oslo_log import log
|
||||
|
||||
from watcher.decision_engine.api.strategy.strategy_context import\
|
||||
BaseStrategyContext
|
||||
from watcher.decision_engine.framework.default_planner import DefaultPlanner
|
||||
from watcher.decision_engine.framework.strategy.strategy_selector import \
|
||||
StrategySelector
|
||||
from watcher.decision_engine.planner.default import DefaultPlanner
|
||||
from watcher.decision_engine.strategy.context.base import BaseStrategyContext
|
||||
from watcher.decision_engine.strategy.selector.default import StrategySelector
|
||||
|
||||
LOG = log.getLogger(__name__)
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
#
|
||||
from oslo_log import log
|
||||
|
||||
from watcher.decision_engine.api.strategy.strategy import BaseStrategy
|
||||
from watcher.decision_engine.framework.meta_actions.nop import Nop
|
||||
from watcher.decision_engine.meta_action.nop import Nop
|
||||
from watcher.decision_engine.strategy.base import BaseStrategy
|
||||
|
||||
LOG = log.getLogger(__name__)
|
||||
|
||||
@@ -21,7 +21,7 @@ from __future__ import unicode_literals
|
||||
|
||||
from oslo_log import log
|
||||
from stevedore import ExtensionManager
|
||||
from watcher.decision_engine.strategies.basic_consolidation import \
|
||||
from watcher.decision_engine.strategy.basic_consolidation import \
|
||||
BasicConsolidation
|
||||
|
||||
LOG = log.getLogger(__name__)
|
||||
@@ -16,9 +16,8 @@
|
||||
|
||||
from oslo_config import cfg
|
||||
from oslo_log import log
|
||||
from watcher.decision_engine.api.strategy.selector import Selector
|
||||
from watcher.decision_engine.framework.strategy.strategy_loader import \
|
||||
StrategyLoader
|
||||
from watcher.decision_engine.strategy.loader import StrategyLoader
|
||||
from watcher.decision_engine.strategy.selector.base import Selector
|
||||
from watcher.objects.audit_template import Goal
|
||||
|
||||
LOG = log.getLogger(__name__)
|
||||
Reference in New Issue
Block a user