Add 'identity' key to mcollective configuration data

'identity' parameter represents id of the node and is placed in
mcollective config by nailgun-agent. But sometimes such behavior
(especially if to take into consideration that restart of mcollective
follows it) may lead to failed deployment (See related bug). Now the parameter
is supplied by nailgun and is used by fuel-agent to create the config
with the data already present in it when node boots after provision is
done.

Change-Id: I753eb76ed9c3b80f249c0c4b86ef48ef49274990
Related-Bug: #1518306
This commit is contained in:
Artem Roma 2015-12-14 14:39:53 +02:00
parent 1fd6d29451
commit 98f2d58542
3 changed files with 14 additions and 0 deletions

View File

@ -145,6 +145,15 @@ class ProvisioningSerializer(object):
'mco_password': settings.MCO_PASSWORD,
'mco_connector': settings.MCO_CONNECTOR,
'mco_enable': 1,
# NOTE(aroma): identity parameter usually is added/updated
# by nailgun agent but due to particularities of its execution
# flow such action may lead to deployment failures [1].
# Hence we supply the information here so fuel-agent will
# create mcollective config initially with the data present,
# [1]: https://bugs.launchpad.net/fuel/+bug/1518306
'mco_identity': node.id,
'auth_key': "\"%s\"" % cluster_attrs.get('auth_key', ''),
'authorized_keys':
["\"%s\"" % key for key in settings.AUTHORIZED_KEYS],

View File

@ -289,6 +289,7 @@ class TestHandlers(BaseIntegrationTest):
'mco_password': settings.MCO_PASSWORD,
'mco_connector': settings.MCO_CONNECTOR,
'mco_enable': 1,
'mco_identity': n.id,
'pm_data': {
'ks_spaces': VolumeManagerExtension.get_node_volumes(
n),
@ -754,6 +755,7 @@ class TestHandlers(BaseIntegrationTest):
'mco_password': settings.MCO_PASSWORD,
'mco_connector': settings.MCO_CONNECTOR,
'mco_enable': 1,
'mco_identity': n.id,
'pm_data': {
'ks_spaces': VolumeManagerExtension.get_node_volumes(
n),
@ -1259,6 +1261,7 @@ class TestHandlers(BaseIntegrationTest):
'mco_password': settings.MCO_PASSWORD,
'mco_connector': settings.MCO_CONNECTOR,
'mco_enable': 1,
'mco_identity': n.id,
'pm_data': {
'ks_spaces': VolumeManagerExtension.get_node_volumes(
n),

View File

@ -183,6 +183,8 @@ class TestProvisioningSerializer(BaseIntegrationTest):
'peerdns': 'no',
'onboot': 'yes'
})
# check identity key for mcollective
self.assertEqual(node['ks_meta']['mco_identity'], node_db.id)
def test_node_serialization_w_bonded_admin_iface(self):
self.cluster_db = self.env.clusters[0]