Code refactoring - Watcher Applier 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: Id7b37667c613086d8ef3cd1f367c4219bf026fc7
This commit is contained in:
Vincent Françoise
2015-11-27 10:32:12 +01:00
parent 6d17426675
commit 289c79e52f
42 changed files with 42 additions and 51 deletions

View File

@@ -28,7 +28,7 @@ from watcher.api.controllers import link
from watcher.api.controllers.v1 import collection
from watcher.api.controllers.v1 import types
from watcher.api.controllers.v1 import utils as api_utils
from watcher.applier.framework.rpcapi import ApplierAPI
from watcher.applier.rpcapi import ApplierAPI
from watcher.common import exception
from watcher import objects

View File

@@ -16,8 +16,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
from watcher.applier.api.applier import Applier
from watcher.applier.framework.command_executor import CommandExecutor
from watcher.applier.base import Applier
from watcher.applier.execution.executor import CommandExecutor
from watcher.objects import Action
from watcher.objects import ActionPlan

View File

@@ -18,11 +18,10 @@
#
from oslo_log import log
from watcher.applier.framework.default_command_mapper import \
DefaultCommandMapper
from watcher.applier.mapper.default import DefaultCommandMapper
from watcher.applier.framework.deploy_phase import DeployPhase
from watcher.applier.framework.messaging.events import Events
from watcher.applier.execution.deploy_phase import DeployPhase
from watcher.applier.messaging.events import Events
from watcher.common.messaging.events.event import Event
from watcher.objects import Action
from watcher.objects.action_plan import Status

View File

@@ -21,8 +21,7 @@ from concurrent.futures import ThreadPoolExecutor
from oslo_config import cfg
from oslo_log import log
from watcher.applier.framework.messaging.trigger_action_plan import \
TriggerActionPlan
from watcher.applier.messaging.trigger import TriggerActionPlan
from watcher.common.messaging.messaging_core import MessagingCore
from watcher.common.messaging.notification_handler import NotificationHandler
from watcher.decision_engine.messaging.events import Events

View File

@@ -18,13 +18,11 @@
#
from watcher.applier.api.command_mapper import CommandMapper
from watcher.applier.framework.command.hypervisor_state_command import \
HypervisorStateCommand
from watcher.applier.framework.command.migrate_command import MigrateCommand
from watcher.applier.framework.command.nop_command import NopCommand
from watcher.applier.framework.command.power_state_command import \
PowerStateCommand
from watcher.applier.mapper.base import CommandMapper
from watcher.applier.primitive.hypervisor_state import HypervisorStateCommand
from watcher.applier.primitive.migration import MigrateCommand
from watcher.applier.primitive.nop import NopCommand
from watcher.applier.primitive.power_state import PowerStateCommand
from watcher.common.exception import ActionNotFound
from watcher.decision_engine.planner.default import Primitives

View File

@@ -18,9 +18,9 @@
#
from oslo_log import log
from watcher.applier.api.messaging.applier_command import ApplierCommand
from watcher.applier.framework.default_applier import DefaultApplier
from watcher.applier.framework.messaging.events import Events
from watcher.applier.default import DefaultApplier
from watcher.applier.messaging.applier_command import ApplierCommand
from watcher.applier.messaging.events import Events
from watcher.common.messaging.events.event import Event
from watcher.objects.action_plan import ActionPlan
from watcher.objects.action_plan import Status

View File

@@ -18,8 +18,7 @@
#
from oslo_log import log
from watcher.applier.framework.messaging.launch_action_plan import \
LaunchActionPlanCommand
from watcher.applier.messaging.launcher import LaunchActionPlanCommand
LOG = log.getLogger(__name__)

View File

@@ -18,7 +18,7 @@
#
import abc
import six
from watcher.applier.api.promise import Promise
from watcher.applier.promise import Promise
@six.add_metaclass(abc.ABCMeta)

View File

@@ -20,9 +20,9 @@
from oslo_config import cfg
from watcher.applier.api.primitive_command import PrimitiveCommand
from watcher.applier.api.promise import Promise
from watcher.applier.framework.command.wrapper.nova_wrapper import NovaWrapper
from watcher.applier.primitive.base import PrimitiveCommand
from watcher.applier.primitive.wrapper.nova_wrapper import NovaWrapper
from watcher.applier.promise import Promise
from watcher.common.keystone import KeystoneClient
from watcher.decision_engine.model.hypervisor_state import HypervisorState

View File

@@ -21,10 +21,9 @@ from keystoneclient.auth.identity import v3
from keystoneclient import session
from oslo_config import cfg
from watcher.applier.api.primitive_command import PrimitiveCommand
from watcher.applier.api.promise import Promise
from watcher.applier.framework.command.wrapper.nova_wrapper import NovaWrapper
from watcher.applier.primitive.base import PrimitiveCommand
from watcher.applier.primitive.wrapper.nova_wrapper import NovaWrapper
from watcher.applier.promise import Promise
from watcher.common.keystone import KeystoneClient
from watcher.decision_engine.planner.default import Primitives

View File

@@ -19,8 +19,8 @@
from oslo_log import log
from watcher.applier.api.primitive_command import PrimitiveCommand
from watcher.applier.api.promise import Promise
from watcher.applier.primitive.base import PrimitiveCommand
from watcher.applier.promise import Promise
LOG = log.getLogger(__name__)

View File

@@ -16,8 +16,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
from watcher.applier.api.primitive_command import PrimitiveCommand
from watcher.applier.api.promise import Promise
from watcher.applier.primitive.base import PrimitiveCommand
from watcher.applier.promise import Promise
class PowerStateCommand(PrimitiveCommand):

View File

@@ -21,8 +21,8 @@ from oslo_log import log
import oslo_messaging as om
from watcher.applier.framework.manager_applier import APPLIER_MANAGER_OPTS
from watcher.applier.framework.manager_applier import opt_group
from watcher.applier.manager import APPLIER_MANAGER_OPTS
from watcher.applier.manager import opt_group
from watcher.common import exception
from watcher.common.messaging.messaging_core import MessagingCore
from watcher.common.messaging.notification_handler import NotificationHandler

View File

@@ -24,7 +24,7 @@ import sys
from oslo_config import cfg
from oslo_log import log as logging
from watcher.applier.framework.manager_applier import ApplierManager
from watcher.applier.manager import ApplierManager
from watcher.common import service
from watcher import i18n

View File

@@ -20,7 +20,7 @@
from oslo_config import cfg
from oslo_log import log
from watcher.applier.framework.command.wrapper.nova_wrapper import NovaWrapper
from watcher.applier.primitive.wrapper.nova_wrapper import NovaWrapper
from watcher.common.keystone import KeystoneClient
from watcher.metrics_engine.cluster_model_collector.nova import \
NovaClusterModelCollector

View File

@@ -16,7 +16,7 @@
# limitations under the License.
import watcher.api.app
from watcher.applier.framework import manager_applier
from watcher.applier import manager_applier
from watcher.decision_engine import manager
from watcher.decision_engine.strategy.selector import default \
as strategy_selector

View File

@@ -17,7 +17,7 @@ from oslo_utils import timeutils
from wsme import types as wtypes
from watcher.api.controllers.v1 import action_plan as api_action_plan
from watcher.applier.framework import rpcapi as aapi
from watcher.applier import rpcapi as aapi
from watcher.common import utils
from watcher.db import api as db_api
from watcher import objects

View File

@@ -18,7 +18,7 @@
#
import mock
from watcher.applier.framework.command_executor import CommandExecutor
from watcher.applier.execution.executor import CommandExecutor
from watcher import objects
from watcher.common import utils

View File

@@ -17,8 +17,7 @@
# limitations under the License.
#
import mock
from watcher.applier.framework.default_command_mapper import \
DefaultCommandMapper
from watcher.applier.mapper.default import DefaultCommandMapper
from watcher.decision_engine.planner.default import Primitives
from watcher.tests import base

View File

@@ -20,9 +20,8 @@ from mock import call
from mock import MagicMock
from watcher.applier.framework.messaging.events import Events
from watcher.applier.framework.messaging.launch_action_plan import \
LaunchActionPlanCommand
from watcher.applier.messaging.events import Events
from watcher.applier.messaging.launcher import LaunchActionPlanCommand
from watcher.objects.action_plan import Status
from watcher.objects import ActionPlan

View File

@@ -19,8 +19,7 @@
from mock import MagicMock
from watcher.applier.framework.messaging.trigger_action_plan import \
TriggerActionPlan
from watcher.applier.messaging.trigger import TriggerActionPlan
from watcher.common import utils
from watcher.tests import base

View File

@@ -18,7 +18,7 @@
#
import mock
import time
from watcher.applier.framework.command.wrapper.nova_wrapper import NovaWrapper
from watcher.applier.primitive.wrapper.nova_wrapper import NovaWrapper
from watcher.common import utils
from watcher.tests import base

View File

@@ -16,7 +16,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
from watcher.applier.framework.manager_applier import ApplierManager
from watcher.applier.manager import ApplierManager
from watcher.common.messaging.events.event import Event
from watcher.tests import base

View File

@@ -19,7 +19,7 @@
import mock
import oslo_messaging as om
from watcher.applier.framework.rpcapi import ApplierAPI
from watcher.applier.rpcapi import ApplierAPI
from watcher.common import exception
from watcher.common import utils

View File

@@ -21,7 +21,7 @@ import types
from mock import patch
from oslo_config import cfg
from watcher.applier.framework.manager_applier import ApplierManager
from watcher.applier.manager import ApplierManager
from watcher.cmd import applier
from watcher.tests.base import BaseTestCase