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:
parent
ead3f0acf2
commit
646c08396e
@ -20,8 +20,8 @@ from six.moves.urllib import parse as urlparse
|
|||||||
|
|
||||||
from heat.common.i18n import _
|
from heat.common.i18n import _
|
||||||
from heat.common.i18n import _LI
|
from heat.common.i18n import _LI
|
||||||
from heat.db import api as db_api
|
|
||||||
from heat.engine import 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_config as software_config_object
|
||||||
from heat.objects import software_deployment as software_deployment_object
|
from heat.objects import software_deployment as software_deployment_object
|
||||||
from heat.openstack.common import service
|
from heat.openstack.common import service
|
||||||
@ -72,7 +72,8 @@ class SoftwareConfigService(service.Service):
|
|||||||
return result
|
return result
|
||||||
|
|
||||||
def _push_metadata_software_deployments(self, cnxt, server_id):
|
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:
|
if not rs:
|
||||||
return
|
return
|
||||||
deployments = self.metadata_software_deployments(cnxt, server_id)
|
deployments = self.metadata_software_deployments(cnxt, server_id)
|
||||||
|
@ -3946,8 +3946,8 @@ class SoftwareConfigServiceTest(common.HeatTestCase):
|
|||||||
|
|
||||||
@mock.patch.object(service_software_config.SoftwareConfigService,
|
@mock.patch.object(service_software_config.SoftwareConfigService,
|
||||||
'metadata_software_deployments')
|
'metadata_software_deployments')
|
||||||
@mock.patch.object(service_software_config.db_api,
|
@mock.patch.object(service_software_config.resource_object.Resource,
|
||||||
'resource_get_by_physical_resource_id')
|
'get_by_physical_resource_id')
|
||||||
@mock.patch.object(service_software_config.requests, 'put')
|
@mock.patch.object(service_software_config.requests, 'put')
|
||||||
def test_push_metadata_software_deployments(self, put, res_get, md_sd):
|
def test_push_metadata_software_deployments(self, put, res_get, md_sd):
|
||||||
rs = mock.Mock()
|
rs = mock.Mock()
|
||||||
@ -3971,8 +3971,8 @@ class SoftwareConfigServiceTest(common.HeatTestCase):
|
|||||||
|
|
||||||
@mock.patch.object(service_software_config.SoftwareConfigService,
|
@mock.patch.object(service_software_config.SoftwareConfigService,
|
||||||
'metadata_software_deployments')
|
'metadata_software_deployments')
|
||||||
@mock.patch.object(service_software_config.db_api,
|
@mock.patch.object(service_software_config.resource_object.Resource,
|
||||||
'resource_get_by_physical_resource_id')
|
'get_by_physical_resource_id')
|
||||||
@mock.patch.object(service_software_config.requests, 'put')
|
@mock.patch.object(service_software_config.requests, 'put')
|
||||||
def test_push_metadata_software_deployments_temp_url(
|
def test_push_metadata_software_deployments_temp_url(
|
||||||
self, put, res_get, md_sd):
|
self, put, res_get, md_sd):
|
||||||
|
Loading…
Reference in New Issue
Block a user