From 1f8ca0c27979a25d7119c0bcedb7e29fad3a2bf3 Mon Sep 17 00:00:00 2001 From: huangtianhua Date: Sun, 15 Feb 2015 10:34:32 +0800 Subject: [PATCH] Move nova resources to engine/resources/openstack/nova/ Change-Id: Ic07bbd9b356c581db4ffe47835e84900ffa41d8a Implements: blueprint reorganize-resources-code-structure --- contrib/rackspace/rackspace/resources/cloud_server.py | 3 ++- heat/engine/resources/openstack/nova/__init__.py | 0 heat/engine/resources/{ => openstack/nova}/nova_floatingip.py | 0 heat/engine/resources/{ => openstack/nova}/nova_keypair.py | 0 heat/engine/resources/{ => openstack/nova}/nova_servergroup.py | 0 heat/engine/resources/{ => openstack/nova}/server.py | 0 heat/tests/test_environment.py | 3 ++- heat/tests/test_metadata_refresh.py | 2 +- heat/tests/test_nova_floatingip.py | 2 +- heat/tests/test_nova_keypair.py | 2 +- heat/tests/test_server.py | 2 +- 11 files changed, 8 insertions(+), 6 deletions(-) create mode 100644 heat/engine/resources/openstack/nova/__init__.py rename heat/engine/resources/{ => openstack/nova}/nova_floatingip.py (100%) rename heat/engine/resources/{ => openstack/nova}/nova_keypair.py (100%) rename heat/engine/resources/{ => openstack/nova}/nova_servergroup.py (100%) rename heat/engine/resources/{ => openstack/nova}/server.py (100%) diff --git a/contrib/rackspace/rackspace/resources/cloud_server.py b/contrib/rackspace/rackspace/resources/cloud_server.py index 6504e3f584..2dd93a0190 100644 --- a/contrib/rackspace/rackspace/resources/cloud_server.py +++ b/contrib/rackspace/rackspace/resources/cloud_server.py @@ -16,7 +16,8 @@ from oslo_log import log as logging from heat.common import exception from heat.common.i18n import _ from heat.common.i18n import _LW -from heat.engine.resources import server +from heat.engine.resources.openstack.nova import server + try: import pyrax # noqa diff --git a/heat/engine/resources/openstack/nova/__init__.py b/heat/engine/resources/openstack/nova/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/heat/engine/resources/nova_floatingip.py b/heat/engine/resources/openstack/nova/nova_floatingip.py similarity index 100% rename from heat/engine/resources/nova_floatingip.py rename to heat/engine/resources/openstack/nova/nova_floatingip.py diff --git a/heat/engine/resources/nova_keypair.py b/heat/engine/resources/openstack/nova/nova_keypair.py similarity index 100% rename from heat/engine/resources/nova_keypair.py rename to heat/engine/resources/openstack/nova/nova_keypair.py diff --git a/heat/engine/resources/nova_servergroup.py b/heat/engine/resources/openstack/nova/nova_servergroup.py similarity index 100% rename from heat/engine/resources/nova_servergroup.py rename to heat/engine/resources/openstack/nova/nova_servergroup.py diff --git a/heat/engine/resources/server.py b/heat/engine/resources/openstack/nova/server.py similarity index 100% rename from heat/engine/resources/server.py rename to heat/engine/resources/openstack/nova/server.py diff --git a/heat/tests/test_environment.py b/heat/tests/test_environment.py index a59e503269..93c6202dad 100644 --- a/heat/tests/test_environment.py +++ b/heat/tests/test_environment.py @@ -23,6 +23,7 @@ from heat.common import environment_format from heat.engine import environment from heat.engine import resources from heat.engine.resources.aws.ec2 import instance +from heat.engine.resources.openstack.nova import server from heat.tests import common from heat.tests import generic_resource @@ -408,7 +409,7 @@ class GlobalEnvLoadingTest(common.HeatTestCase): self.assertIsNone(g_env.get_resource_info('AWS::EC2::Instance')) # 4. make sure we haven't removed something we shouldn't have - self.assertEqual(resources.server.Server, + self.assertEqual(server.Server, g_env.get_resource_info('OS::Nova::Server').value) def test_env_user_cant_disable_sys_resource(self): diff --git a/heat/tests/test_metadata_refresh.py b/heat/tests/test_metadata_refresh.py index 71d8f571c0..3a2ef03078 100644 --- a/heat/tests/test_metadata_refresh.py +++ b/heat/tests/test_metadata_refresh.py @@ -21,7 +21,7 @@ from heat.engine import environment from heat.engine import parser from heat.engine.resources.aws.cfn import wait_condition_handle as aws_wch from heat.engine.resources.aws.ec2 import instance -from heat.engine.resources import server +from heat.engine.resources.openstack.nova import server from heat.engine import scheduler from heat.engine import service from heat.tests import common diff --git a/heat/tests/test_nova_floatingip.py b/heat/tests/test_nova_floatingip.py index 28de5f3ffa..11579c4332 100644 --- a/heat/tests/test_nova_floatingip.py +++ b/heat/tests/test_nova_floatingip.py @@ -19,7 +19,7 @@ import six from heat.common import exception as heat_ex from heat.common import template_format from heat.engine.clients.os import nova -from heat.engine.resources import nova_floatingip +from heat.engine.resources.openstack.nova import nova_floatingip from heat.engine import rsrc_defn from heat.engine import scheduler from heat.tests import common diff --git a/heat/tests/test_nova_keypair.py b/heat/tests/test_nova_keypair.py index 18338b17e1..aa36671284 100644 --- a/heat/tests/test_nova_keypair.py +++ b/heat/tests/test_nova_keypair.py @@ -18,7 +18,7 @@ import six from heat.common import exception from heat.engine.clients.os import nova -from heat.engine.resources import nova_keypair +from heat.engine.resources.openstack.nova import nova_keypair from heat.engine import scheduler from heat.tests import common from heat.tests import utils diff --git a/heat/tests/test_server.py b/heat/tests/test_server.py index df6e7e3d88..ce7c940e10 100644 --- a/heat/tests/test_server.py +++ b/heat/tests/test_server.py @@ -31,7 +31,7 @@ from heat.engine.clients.os import swift from heat.engine import environment from heat.engine import parser from heat.engine import resource -from heat.engine.resources import server as servers +from heat.engine.resources.openstack.nova import server as servers from heat.engine import scheduler from heat.engine import template from heat.tests import common