Move resource inheritance class to engine/resources

Move the resources which inherit from 'Resource'
to engine/resources, such as stack_resource,
stack_user and signal_responder, and move
non-resources to engine/, such as iso_8601.py module.

Change-Id: Ic26c34cc8d34ca03ce674dc8c6ac32c10885b75f
Implements: blueprint reorganize-resources-code-structure
This commit is contained in:
huangtianhua 2015-02-15 16:25:30 +08:00
parent a26d61357c
commit a1336e2527
26 changed files with 28 additions and 28 deletions

View File

@ -20,7 +20,7 @@ from heat.common.i18n import _LI
from heat.engine import attributes from heat.engine import attributes
from heat.engine import constraints from heat.engine import constraints
from heat.engine import properties from heat.engine import properties
from heat.engine import signal_responder from heat.engine.resources import signal_responder
from heat.scaling import cooldown from heat.scaling import cooldown
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@ -19,7 +19,7 @@ from heat.common import template_format
from heat.common import urlfetch from heat.common import urlfetch
from heat.engine import attributes from heat.engine import attributes
from heat.engine import properties from heat.engine import properties
from heat.engine import stack_resource from heat.engine.resources import stack_resource
class NestedStack(stack_resource.StackResource): class NestedStack(stack_resource.StackResource):

View File

@ -13,8 +13,8 @@
import six import six
from heat.engine.resources import signal_responder
from heat.engine.resources import wait_condition as wc_base from heat.engine.resources import wait_condition as wc_base
from heat.engine import signal_responder
from heat.engine import support from heat.engine import support

View File

@ -21,7 +21,7 @@ from heat.engine import attributes
from heat.engine import constraints from heat.engine import constraints
from heat.engine import properties from heat.engine import properties
from heat.engine import resource from heat.engine import resource
from heat.engine import stack_user from heat.engine.resources import stack_user
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@ -23,7 +23,7 @@ from heat.common import template_format
from heat.engine import attributes from heat.engine import attributes
from heat.engine import constraints from heat.engine import constraints
from heat.engine import properties from heat.engine import properties
from heat.engine import stack_resource from heat.engine.resources import stack_resource
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@ -19,7 +19,7 @@ from heat.common.i18n import _LI
from heat.engine import attributes from heat.engine import attributes
from heat.engine import constraints from heat.engine import constraints
from heat.engine import properties from heat.engine import properties
from heat.engine import signal_responder from heat.engine.resources import signal_responder
from heat.engine import support from heat.engine import support
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@ -18,9 +18,9 @@ from heat.common import timeutils as iso8601utils
from heat.engine import attributes from heat.engine import attributes
from heat.engine import function from heat.engine import function
from heat.engine import properties from heat.engine import properties
from heat.engine.resources import stack_resource
from heat.engine import rsrc_defn from heat.engine import rsrc_defn
from heat.engine import scheduler from heat.engine import scheduler
from heat.engine import stack_resource
from heat.scaling import lbutils from heat.scaling import lbutils
from heat.scaling import template from heat.scaling import template

View File

@ -22,7 +22,7 @@ from heat.common.i18n import _
from heat.engine import attributes from heat.engine import attributes
from heat.engine import constraints from heat.engine import constraints
from heat.engine import properties from heat.engine import properties
from heat.engine import stack_resource from heat.engine.resources import stack_resource
from heat.engine import support from heat.engine import support
from heat.engine import template from heat.engine import template

View File

@ -21,7 +21,7 @@ from heat.engine import attributes
from heat.engine import constraints from heat.engine import constraints
from heat.engine import properties from heat.engine import properties
from heat.engine import resource from heat.engine import resource
from heat.engine import signal_responder from heat.engine.resources import signal_responder
from heat.scaling import cooldown from heat.scaling import cooldown
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@ -25,7 +25,7 @@ from heat.engine import properties
from heat.engine import resource from heat.engine import resource
from heat.engine.resources.openstack.heat import resource_group from heat.engine.resources.openstack.heat import resource_group
from heat.engine.resources.openstack.heat import software_config as sc from heat.engine.resources.openstack.heat import software_config as sc
from heat.engine import signal_responder from heat.engine.resources import signal_responder
from heat.engine import support from heat.engine import support
from heat.rpc import api as rpc_api from heat.rpc import api as rpc_api

View File

@ -28,8 +28,8 @@ from heat.engine import constraints
from heat.engine import properties from heat.engine import properties
from heat.engine import resource from heat.engine import resource
from heat.engine.resources.openstack.neutron import subnet from heat.engine.resources.openstack.neutron import subnet
from heat.engine.resources import stack_user
from heat.engine import scheduler from heat.engine import scheduler
from heat.engine import stack_user
from heat.engine import support from heat.engine import support
from heat.rpc import api as rpc_api from heat.rpc import api as rpc_api

View File

@ -17,7 +17,7 @@ from oslo_log import log as logging
from six.moves.urllib import parse as urlparse from six.moves.urllib import parse as urlparse
from heat.common.i18n import _LW from heat.common.i18n import _LW
from heat.engine import stack_user from heat.engine.resources import stack_user
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@ -22,7 +22,7 @@ from heat.common import urlfetch
from heat.engine import attributes from heat.engine import attributes
from heat.engine import environment from heat.engine import environment
from heat.engine import properties from heat.engine import properties
from heat.engine import stack_resource from heat.engine.resources import stack_resource
from heat.engine import template from heat.engine import template

View File

@ -17,7 +17,7 @@ from heat.common import exception
from heat.common.i18n import _ from heat.common.i18n import _
from heat.common.i18n import _LE from heat.common.i18n import _LE
from heat.common.i18n import _LW from heat.common.i18n import _LW
from heat.engine import signal_responder from heat.engine.resources import signal_responder
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@ -20,8 +20,8 @@ from heat.engine import attributes
from heat.engine import constraints from heat.engine import constraints
from heat.engine import properties from heat.engine import properties
from heat.engine import resource from heat.engine import resource
from heat.engine import signal_responder from heat.engine.resources import signal_responder
from heat.engine import stack_user from heat.engine.resources import stack_user
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@ -11,7 +11,7 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from heat.engine.resources import iso_8601 from heat.engine import iso_8601
from heat.tests import common from heat.tests import common

View File

@ -40,7 +40,7 @@ class NovaClientPluginTestCase(common.HeatTestCase):
class NovaClientPluginTests(NovaClientPluginTestCase): class NovaClientPluginTests(NovaClientPluginTestCase):
""" """
Basic tests for the helper methods in Basic tests for the helper methods in
:module:'heat.engine.resources.nova_utils'. :module:'heat.engine.nova_utils'.
""" """
def test_get_ip(self): def test_get_ip(self):

View File

@ -20,7 +20,7 @@ from novaclient import exceptions as nova_exceptions
import six import six
from heat.common import exception from heat.common import exception
from heat.engine.resources import nova_utils from heat.engine import nova_utils
from heat.engine import scheduler from heat.engine import scheduler
from heat.tests import common from heat.tests import common
from heat.tests.v1_1 import fakes as fakes_v1_1 from heat.tests.v1_1 import fakes as fakes_v1_1
@ -29,14 +29,14 @@ from heat.tests.v1_1 import fakes as fakes_v1_1
class NovaUtilsTests(common.HeatTestCase): class NovaUtilsTests(common.HeatTestCase):
""" """
Basic tests for the helper methods in Basic tests for the helper methods in
:module:'heat.engine.resources.nova_utils'. :module:'heat.engine.nova_utils'.
""" """
def setUp(self): def setUp(self):
super(NovaUtilsTests, self).setUp() super(NovaUtilsTests, self).setUp()
self.nova_client = self.m.CreateMockAnything() self.nova_client = self.m.CreateMockAnything()
self.mock_warnings = mock.patch( self.mock_warnings = mock.patch(
'heat.engine.resources.nova_utils.warnings') 'heat.engine.nova_utils.warnings')
self.mock_warnings.start() self.mock_warnings.start()
self.addCleanup(self.mock_warnings.stop) self.addCleanup(self.mock_warnings.stop)
@ -133,7 +133,7 @@ class NovaUtilsRefreshServerTests(common.HeatTestCase):
def setUp(self): def setUp(self):
super(NovaUtilsRefreshServerTests, self).setUp() super(NovaUtilsRefreshServerTests, self).setUp()
self.mock_warnings = mock.patch( self.mock_warnings = mock.patch(
'heat.engine.resources.nova_utils.warnings') 'heat.engine.nova_utils.warnings')
self.mock_warnings.start() self.mock_warnings.start()
self.addCleanup(self.mock_warnings.stop) self.addCleanup(self.mock_warnings.stop)
@ -182,7 +182,7 @@ class NovaUtilsUserdataTests(common.HeatTestCase):
super(NovaUtilsUserdataTests, self).setUp() super(NovaUtilsUserdataTests, self).setUp()
self.nova_client = self.m.CreateMockAnything() self.nova_client = self.m.CreateMockAnything()
self.mock_warnings = mock.patch( self.mock_warnings = mock.patch(
'heat.engine.resources.nova_utils.warnings') 'heat.engine.nova_utils.warnings')
self.mock_warnings.start() self.mock_warnings.start()
self.addCleanup(self.mock_warnings.stop) self.addCleanup(self.mock_warnings.stop)
@ -246,7 +246,7 @@ class NovaUtilsMetadataTests(common.HeatTestCase):
def setUp(self): def setUp(self):
super(NovaUtilsMetadataTests, self).setUp() super(NovaUtilsMetadataTests, self).setUp()
self.mock_warnings = mock.patch( self.mock_warnings = mock.patch(
'heat.engine.resources.nova_utils.warnings') 'heat.engine.nova_utils.warnings')
self.mock_warnings.start() self.mock_warnings.start()
self.addCleanup(self.mock_warnings.stop) self.addCleanup(self.mock_warnings.stop)

View File

@ -21,8 +21,8 @@ from heat.common import template_format
from heat.db import api as db_api from heat.db import api as db_api
from heat.engine import parser from heat.engine import parser
from heat.engine import resource from heat.engine import resource
from heat.engine.resources import stack_user
from heat.engine import scheduler from heat.engine import scheduler
from heat.engine import stack_user
from heat.engine import template from heat.engine import template
from heat.tests import common from heat.tests import common
from heat.tests import fakes from heat.tests import fakes

View File

@ -20,9 +20,9 @@ import six
from heat.common import exception from heat.common import exception
from heat.common import template_format from heat.common import template_format
from heat.engine import resource from heat.engine import resource
from heat.engine.resources import stack_resource
from heat.engine import scheduler from heat.engine import scheduler
from heat.engine import stack as parser from heat.engine import stack as parser
from heat.engine import stack_resource
from heat.engine import template as templatem from heat.engine import template as templatem
from heat.tests import common from heat.tests import common
from heat.tests import generic_resource as generic_rsrc from heat.tests import generic_resource as generic_rsrc

View File

@ -19,8 +19,8 @@ from heat.common import short_id
from heat.common import template_format from heat.common import template_format
from heat.db import api as db_api from heat.db import api as db_api
from heat.engine import resource from heat.engine import resource
from heat.engine.resources import stack_user
from heat.engine import scheduler from heat.engine import scheduler
from heat.engine import stack_user
from heat.tests import common from heat.tests import common
from heat.tests import fakes from heat.tests import fakes
from heat.tests import generic_resource from heat.tests import generic_resource

View File

@ -64,7 +64,7 @@ heat.constraints =
neutron.router = heat.engine.clients.os.neutron:RouterConstraint neutron.router = heat.engine.clients.os.neutron:RouterConstraint
neutron.subnet = heat.engine.clients.os.neutron:SubnetConstraint neutron.subnet = heat.engine.clients.os.neutron:SubnetConstraint
glance.image = heat.engine.clients.os.glance:ImageConstraint glance.image = heat.engine.clients.os.glance:ImageConstraint
iso_8601 = heat.engine.resources.iso_8601:ISO8601Constraint iso_8601 = heat.engine.iso_8601:ISO8601Constraint
nova.server = heat.engine.clients.os.nova:ServerConstraint nova.server = heat.engine.clients.os.nova:ServerConstraint
nova.keypair = heat.engine.clients.os.nova:KeypairConstraint nova.keypair = heat.engine.clients.os.nova:KeypairConstraint
cinder.volume = heat.engine.clients.os.cinder:VolumeConstraint cinder.volume = heat.engine.clients.os.cinder:VolumeConstraint