Remove signal_id from deployments API and model
The same information is now available from the deployment's derived config deploy_signal_id input value. Other deployment signal transports might not have a single ID to put in this field so it is better at this stage to remove it from the deployments model and do anything that is required using derived config inputs. partial blueprint hot-software-config Change-Id: I90c85d0ceb9fd67eed640c84348ef4175a6194b6
This commit is contained in:
parent
c92aa9b5c5
commit
56b4e61f0c
@ -71,7 +71,7 @@ class SoftwareDeploymentController(object):
|
||||
Create a new software deployment
|
||||
"""
|
||||
create_data = dict((k, body.get(k)) for k in (
|
||||
'config_id', 'server_id', 'input_values', 'signal_id',
|
||||
'config_id', 'server_id', 'input_values',
|
||||
'action', 'status', 'status_reason'))
|
||||
|
||||
sd = self.rpc_client.create_software_deployment(req.context,
|
||||
|
@ -0,0 +1,30 @@
|
||||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
||||
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import sqlalchemy
|
||||
|
||||
|
||||
def upgrade(migrate_engine):
|
||||
meta = sqlalchemy.MetaData(bind=migrate_engine)
|
||||
software_deployment = sqlalchemy.Table(
|
||||
'software_deployment', meta, autoload=True)
|
||||
software_deployment.c.signal_id.drop()
|
||||
|
||||
|
||||
def downgrade(migrate_engine):
|
||||
meta = sqlalchemy.MetaData(bind=migrate_engine)
|
||||
software_deployment = sqlalchemy.Table(
|
||||
'software_deployment', meta, autoload=True)
|
||||
signal_id = sqlalchemy.Column('signal_id', sqlalchemy.String(1024))
|
||||
signal_id.create(software_deployment)
|
@ -297,7 +297,6 @@ class SoftwareDeployment(BASE, HeatBase):
|
||||
nullable=False)
|
||||
input_values = sqlalchemy.Column('input_values', Json)
|
||||
output_values = sqlalchemy.Column('output_values', Json)
|
||||
signal_id = sqlalchemy.Column(sqlalchemy.String(1024))
|
||||
tenant = sqlalchemy.Column(
|
||||
'tenant', sqlalchemy.String(256), nullable=False)
|
||||
action = sqlalchemy.Column('action', sqlalchemy.String(255))
|
||||
|
@ -333,7 +333,6 @@ def format_software_deployment(sd):
|
||||
api.SOFTWARE_DEPLOYMENT_ACTION: sd.action,
|
||||
api.SOFTWARE_DEPLOYMENT_STATUS: sd.status,
|
||||
api.SOFTWARE_DEPLOYMENT_STATUS_REASON: sd.status_reason,
|
||||
api.SOFTWARE_DEPLOYMENT_SIGNAL_ID: sd.signal_id,
|
||||
api.SOFTWARE_DEPLOYMENT_CONFIG_ID: sd.config.id,
|
||||
}
|
||||
return result
|
||||
|
@ -1128,13 +1128,12 @@ class EngineService(service.Service):
|
||||
|
||||
@request_context
|
||||
def create_software_deployment(self, cnxt, server_id, config_id,
|
||||
input_values, signal_id, action, status,
|
||||
input_values, action, status,
|
||||
status_reason):
|
||||
sd = db_api.software_deployment_create(cnxt, {
|
||||
'config_id': config_id,
|
||||
'server_id': server_id,
|
||||
'input_values': input_values,
|
||||
'signal_id': signal_id,
|
||||
'tenant': cnxt.tenant_id,
|
||||
'action': action,
|
||||
'status': status,
|
||||
|
@ -203,7 +203,6 @@ SOFTWARE_DEPLOYMENT_KEYS = (
|
||||
SOFTWARE_DEPLOYMENT_SERVER_ID,
|
||||
SOFTWARE_DEPLOYMENT_INPUT_VALUES,
|
||||
SOFTWARE_DEPLOYMENT_OUTPUT_VALUES,
|
||||
SOFTWARE_DEPLOYMENT_SIGNAL_ID,
|
||||
SOFTWARE_DEPLOYMENT_ACTION,
|
||||
SOFTWARE_DEPLOYMENT_STATUS,
|
||||
SOFTWARE_DEPLOYMENT_STATUS_REASON
|
||||
@ -213,7 +212,6 @@ SOFTWARE_DEPLOYMENT_KEYS = (
|
||||
'server_id',
|
||||
'input_values',
|
||||
'output_values',
|
||||
'signal_id',
|
||||
'action',
|
||||
'status',
|
||||
'status_reason'
|
||||
|
@ -404,14 +404,12 @@ class EngineClient(heat.openstack.common.rpc.proxy.RpcProxy):
|
||||
deployment_id=deployment_id))
|
||||
|
||||
def create_software_deployment(self, cnxt, server_id, config_id=None,
|
||||
input_values={}, signal_id=None,
|
||||
action='INIT', status='COMPLETE',
|
||||
status_reason=''):
|
||||
input_values={}, action='INIT',
|
||||
status='COMPLETE', status_reason=''):
|
||||
return self.call(cnxt, self.make_msg('create_software_deployment',
|
||||
server_id=server_id,
|
||||
config_id=config_id,
|
||||
input_values=input_values,
|
||||
signal_id=signal_id,
|
||||
action=action,
|
||||
status=status,
|
||||
status_reason=status_reason))
|
||||
|
@ -245,3 +245,6 @@ class TestHeatMigrations(test_migrations.BaseMigrationTestCase,
|
||||
|
||||
def _check_039(self, engine, data):
|
||||
self.assertColumnIsNullable(engine, 'stack', 'user_creds_id')
|
||||
|
||||
def _check_040(self, engine, data):
|
||||
self.assertColumnNotExists(engine, 'software_deployment', 'signal_id')
|
||||
|
@ -3407,7 +3407,6 @@ class SoftwareDeploymentControllerTest(ControllerTest, HeatTestCase):
|
||||
'action': 'INIT',
|
||||
'status': 'COMPLETE',
|
||||
'status_reason': None,
|
||||
'signal_id': None,
|
||||
'config_id': config_id,
|
||||
'config': '#!/bin/bash',
|
||||
'name': 'config_mysql',
|
||||
@ -3436,7 +3435,6 @@ class SoftwareDeploymentControllerTest(ControllerTest, HeatTestCase):
|
||||
'action': 'INIT',
|
||||
'status': 'COMPLETE',
|
||||
'status_reason': None,
|
||||
'signal_id': None,
|
||||
'config_id': config_id}
|
||||
return_value = body.copy()
|
||||
deployment_id = 'a45559cd-8736-4375-bc39-d6a7bb62ade2'
|
||||
@ -3462,7 +3460,6 @@ class SoftwareDeploymentControllerTest(ControllerTest, HeatTestCase):
|
||||
'action': 'INIT',
|
||||
'status': 'COMPLETE',
|
||||
'status_reason': None,
|
||||
'signal_id': None,
|
||||
'config_id': config_id}
|
||||
return_value = body.copy()
|
||||
deployment_id = 'a45559cd-8736-4375-bc39-d6a7bb62ade2'
|
||||
|
@ -804,7 +804,6 @@ class FormatSoftwareConfigDeploymentTest(HeatTestCase):
|
||||
deployment.action = 'INIT'
|
||||
deployment.status = 'COMPLETE'
|
||||
deployment.status_reason = 'Because'
|
||||
deployment.signal_id = 'http://192.0.2.2/signal'
|
||||
return deployment
|
||||
|
||||
def test_format_software_config(self):
|
||||
@ -827,7 +826,6 @@ class FormatSoftwareConfigDeploymentTest(HeatTestCase):
|
||||
self.assertEqual(deployment.server_id, result['server_id'])
|
||||
self.assertEqual(deployment.input_values, result['input_values'])
|
||||
self.assertEqual(deployment.output_values, result['output_values'])
|
||||
self.assertEqual(deployment.signal_id, result['signal_id'])
|
||||
self.assertEqual(deployment.action, result['action'])
|
||||
self.assertEqual(deployment.status, result['status'])
|
||||
self.assertEqual(deployment.status_reason, result['status_reason'])
|
||||
|
@ -2584,7 +2584,7 @@ class SoftwareConfigServiceTest(HeatTestCase):
|
||||
self.ctx, config_id)
|
||||
|
||||
def _create_software_deployment(self, config_id=None, input_values={},
|
||||
signal_id=None, action='INIT',
|
||||
action='INIT',
|
||||
status='COMPLETE', status_reason='',
|
||||
config_group=None,
|
||||
server_id=str(uuid.uuid4()),
|
||||
@ -2594,7 +2594,7 @@ class SoftwareConfigServiceTest(HeatTestCase):
|
||||
name=config_name)
|
||||
config_id = config['id']
|
||||
return self.engine.create_software_deployment(
|
||||
self.ctx, server_id, config_id, input_values, signal_id,
|
||||
self.ctx, server_id, config_id, input_values,
|
||||
action, status, status_reason)
|
||||
|
||||
def test_list_software_deployments(self):
|
||||
@ -2666,7 +2666,6 @@ class SoftwareConfigServiceTest(HeatTestCase):
|
||||
kwargs = {
|
||||
'config_id': config_id,
|
||||
'input_values': {'mode': 'standalone'},
|
||||
'signal_id': None,
|
||||
'action': 'INIT',
|
||||
'status': 'COMPLETE',
|
||||
'status_reason': ''
|
||||
|
@ -246,7 +246,6 @@ class EngineRpcAPITestCase(testtools.TestCase):
|
||||
server_id='9f1f0e00-05d2-4ca5-8602-95021f19c9d0',
|
||||
config_id='48e8ade1-9196-42d5-89a2-f709fde42632',
|
||||
input_values={},
|
||||
signal_id=None,
|
||||
action='INIT',
|
||||
status='COMPLETE',
|
||||
status_reason=None)
|
||||
|
Loading…
Reference in New Issue
Block a user