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
changes/41/156041/10
huangtianhua 8 years ago
parent a26d61357c
commit a1336e2527
  1. 0
      heat/engine/iso_8601.py
  2. 0
      heat/engine/nova_utils.py
  3. 2
      heat/engine/resources/aws/autoscaling/scaling_policy.py
  4. 2
      heat/engine/resources/aws/cfn/stack.py
  5. 2
      heat/engine/resources/aws/cfn/wait_condition_handle.py
  6. 2
      heat/engine/resources/aws/iam/user.py
  7. 2
      heat/engine/resources/aws/lb/loadbalancer.py
  8. 2
      heat/engine/resources/openstack/heat/ha_restarter.py
  9. 2
      heat/engine/resources/openstack/heat/instance_group.py
  10. 2
      heat/engine/resources/openstack/heat/resource_group.py
  11. 2
      heat/engine/resources/openstack/heat/scaling_policy.py
  12. 2
      heat/engine/resources/openstack/heat/software_deployment.py
  13. 2
      heat/engine/resources/openstack/nova/server.py
  14. 2
      heat/engine/resources/signal_responder.py
  15. 0
      heat/engine/resources/stack_resource.py
  16. 0
      heat/engine/resources/stack_user.py
  17. 2
      heat/engine/resources/template_resource.py
  18. 2
      heat/engine/resources/wait_condition.py
  19. 4
      heat/tests/generic_resource.py
  20. 2
      heat/tests/test_iso_8601.py
  21. 2
      heat/tests/test_nova_client.py
  22. 12
      heat/tests/test_nova_utils.py
  23. 2
      heat/tests/test_signal.py
  24. 2
      heat/tests/test_stack_resource.py
  25. 2
      heat/tests/test_stack_user.py
  26. 2
      setup.cfg

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

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

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

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

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

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

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

@ -22,7 +22,7 @@ from heat.common.i18n import _
from heat.engine import attributes
from heat.engine import constraints
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 template

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

@ -25,7 +25,7 @@ from heat.engine import properties
from heat.engine import resource
from heat.engine.resources.openstack.heat import resource_group
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.rpc import api as rpc_api

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

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

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

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

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

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

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

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

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

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

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

@ -64,7 +64,7 @@ heat.constraints =
neutron.router = heat.engine.clients.os.neutron:RouterConstraint
neutron.subnet = heat.engine.clients.os.neutron:SubnetConstraint
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.keypair = heat.engine.clients.os.nova:KeypairConstraint
cinder.volume = heat.engine.clients.os.cinder:VolumeConstraint

Loading…
Cancel
Save