Generate a unique DeployIdentifier on updates

This patch updates 'overcloud deploy' commands so that
updates (re-running deploy on an existing stack) generate
a unique DeployIdentifier parameter. By passing an unique
DeployIdentifier parameter into the overcloud stack we
force all puppet config tasks (which are idempotent
and safe to exec multiple times) again.

We've had several issues with puppet not-rerunning on
a variety of config related changes and additionally recieved
user feedback that not re-running all puppet deployments on
an update is confusing.

Change-Id: Ia659181872a6537cc169f1d1531ebf5d36160183
Closes-bug: #1505430
Depends-On: Ic352ddd30807dc378e5e7b6c396bc53f5d6d5622
This commit is contained in:
Dan Prince 2015-11-11 17:52:13 -05:00
parent 27b6c0aa78
commit ed945a9080
2 changed files with 11 additions and 2 deletions

View File

@ -80,7 +80,8 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
@mock.patch('tripleoclient.utils.create_cephx_key',
autospec=True)
@mock.patch('uuid.uuid1', autospec=True)
def test_tht_scale(self, mock_uuid1, mock_create_cephx_key,
@mock.patch('time.time', autospec=True)
def test_tht_scale(self, mock_time, mock_uuid1, mock_create_cephx_key,
mock_check_hypervisor_stats, mock_get_key,
mock_create_env, generate_certs_mock,
mock_get_templte_contents, mock_process_multiple_env,
@ -101,6 +102,7 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
mock_create_cephx_key.return_value = "cephx_key"
mock_uuid1.return_value = "uuid"
mock_time.return_value = 123456789
mock_generate_overcloud_passwords.return_value = self._get_passwords()
@ -167,6 +169,7 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
'SwiftHashSuffix': 'password',
'SwiftPassword': 'password',
'SwiftStorageImage': 'overcloud-full',
'DeployIdentifier': 123456789,
}
def _custom_create_params_env(parameters):
@ -230,7 +233,8 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
@mock.patch('tripleoclient.utils.create_cephx_key',
autospec=True)
@mock.patch('uuid.uuid1', autospec=True)
def test_tht_deploy(self, mock_uuid1, mock_create_cephx_key,
@mock.patch('time.time', autospec=True)
def test_tht_deploy(self, mock_time, mock_uuid1, mock_create_cephx_key,
mock_check_hypervisor_stats, mock_get_key,
mock_create_env, generate_certs_mock,
mock_get_templte_contents, mock_process_multiple_env,
@ -251,6 +255,7 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
mock_create_cephx_key.return_value = "cephx_key"
mock_uuid1.return_value = "uuid"
mock_time.return_value = 123456789
mock_generate_overcloud_passwords.return_value = self._get_passwords()
@ -332,6 +337,7 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
'SwiftHashSuffix': 'password',
'SwiftPassword': 'password',
'SwiftStorageImage': 'overcloud-full',
'DeployIdentifier': 123456789,
}
def _custom_create_params_env(parameters):

View File

@ -23,6 +23,7 @@ import re
import six
import sys
import tempfile
import time
import uuid
from cliff import command
@ -91,6 +92,8 @@ class DeployOvercloud(command.Command):
self.log.debug("Getting ctlplane from Neutron")
net = network_client.api.find_attr('networks', 'ctlplane')
parameters['NeutronControlPlaneID'] = net['id']
timestamp = int(time.time())
parameters['DeployIdentifier'] = timestamp
param_args = (
('NeutronPublicInterface', 'neutron_public_interface'),