Fixes SoftwareConfigService to use Resource object

Fixes SoftwareConfigService to use Resource object
in place resource db api.

Implements blueprint versioned-objects

Change-Id: Idd9b1215275d899bbf8a7c1a603af9c35dda3008
This commit is contained in:
Kanagaraj Manickam 2015-03-18 15:03:37 +05:30
parent ead3f0acf2
commit 646c08396e
2 changed files with 7 additions and 6 deletions

View File

@ -20,8 +20,8 @@ from six.moves.urllib import parse as urlparse
from heat.common.i18n import _
from heat.common.i18n import _LI
from heat.db import api as db_api
from heat.engine import api
from heat.objects import resource as resource_object
from heat.objects import software_config as software_config_object
from heat.objects import software_deployment as software_deployment_object
from heat.openstack.common import service
@ -72,7 +72,8 @@ class SoftwareConfigService(service.Service):
return result
def _push_metadata_software_deployments(self, cnxt, server_id):
rs = db_api.resource_get_by_physical_resource_id(cnxt, server_id)
rs = (resource_object.Resource.
get_by_physical_resource_id(cnxt, server_id))
if not rs:
return
deployments = self.metadata_software_deployments(cnxt, server_id)

View File

@ -3946,8 +3946,8 @@ class SoftwareConfigServiceTest(common.HeatTestCase):
@mock.patch.object(service_software_config.SoftwareConfigService,
'metadata_software_deployments')
@mock.patch.object(service_software_config.db_api,
'resource_get_by_physical_resource_id')
@mock.patch.object(service_software_config.resource_object.Resource,
'get_by_physical_resource_id')
@mock.patch.object(service_software_config.requests, 'put')
def test_push_metadata_software_deployments(self, put, res_get, md_sd):
rs = mock.Mock()
@ -3971,8 +3971,8 @@ class SoftwareConfigServiceTest(common.HeatTestCase):
@mock.patch.object(service_software_config.SoftwareConfigService,
'metadata_software_deployments')
@mock.patch.object(service_software_config.db_api,
'resource_get_by_physical_resource_id')
@mock.patch.object(service_software_config.resource_object.Resource,
'get_by_physical_resource_id')
@mock.patch.object(service_software_config.requests, 'put')
def test_push_metadata_software_deployments_temp_url(
self, put, res_get, md_sd):