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
(cherry picked from commit ed945a9080)
This commit is contained in:
Dan Prince 2015-11-11 17:52:13 -05:00 committed by Dougal Matthews
parent 1e2c0ff346
commit cac3fb356f
2 changed files with 12 additions and 2 deletions

View File

@ -84,7 +84,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,
@ -106,6 +107,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()
@ -175,6 +177,7 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
'SwiftHashSuffix': 'password',
'SwiftPassword': 'password',
'SwiftStorageImage': 'overcloud-full',
'DeployIdentifier': 123456789,
}
def _custom_create_params_env(parameters):
@ -239,7 +242,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,
@ -260,6 +264,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()
@ -341,6 +346,7 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
'SwiftHashSuffix': 'password',
'SwiftPassword': 'password',
'SwiftStorageImage': 'overcloud-full',
'DeployIdentifier': 123456789,
}
def _custom_create_params_env(parameters):

View File

@ -22,6 +22,7 @@ import re
import six
import sys
import tempfile
import time
import uuid
from cliff import command
@ -91,6 +92,9 @@ class DeployOvercloud(command.Command):
self.log.debug("Generating overcloud passwords")
self.set_overcloud_passwords(parameters, args)
timestamp = int(time.time())
parameters['DeployIdentifier'] = timestamp
param_args = (
('NeutronPublicInterface', 'neutron_public_interface'),
('NeutronBridgeMappings', 'neutron_bridge_mappings'),