Add processing of 'identity' parameter for mcollective config

Nailgun-agent provided the parameter for the config and restarts
mcollective after update. But in some cases (see description of the
related bug) such behavior may cause deployment failure. So now the data
is supplied by astute in provision info and is placed into config on its
creation as other parameters.

Change-Id: I3670e571c13808da2b54bd6238d228e7cdb0ef96
Related-Bug: #1518306
Depends-On: I753eb76ed9c3b80f249c0c4b86ef48ef49274990
This commit is contained in:
Artem Roma 2015-12-14 15:04:04 +02:00 committed by Alexander Gordeev
parent ce509bfd9c
commit 0344c32678
7 changed files with 10 additions and 3 deletions

View File

@ -543,7 +543,8 @@ class Nailgun(BaseDataDriver,
user=data['ks_meta']['mco_user'],
password=data['ks_meta']['mco_password'],
connector=data['ks_meta']['mco_connector'],
enable=data['ks_meta']['mco_enable']
enable=data['ks_meta']['mco_enable'],
identity=data['ks_meta']['mco_identity']
)
LOG.debug('Setting configdrive profile %s' % data['profile'])

View File

@ -44,7 +44,8 @@ class ConfigDrivePuppet(object):
class ConfigDriveMcollective(object):
def __init__(self, pskey, vhost, host, user, password, connector, enable):
def __init__(self, pskey, vhost, host, user, password, connector,
enable, identity):
self.pskey = pskey
self.vhost = vhost
self.host = host
@ -52,6 +53,7 @@ class ConfigDriveMcollective(object):
self.password = password
self.connector = connector
self.enable = enable
self.identity = identity
class ConfigDriveScheme(object):

View File

@ -60,6 +60,7 @@
"mco_pskey": "unset",
"mco_user": "mcollective",
"mco_vhost": "mcollective",
"mco_identity": -1,
"pm_data": {
"kernel_params": "console=ttyS0,9600 console=tty0 rootdelay=90 nomodeset",
"ks_spaces": []

View File

@ -63,7 +63,7 @@ class TestConfigDriveScheme(unittest2.TestCase):
'timezone', {'repo1': 'repo1_url', 'repo2': 'repo2_url'}, 'gw')
cd_puppet = configdrive.ConfigDrivePuppet('master', 0)
cd_mcollective = configdrive.ConfigDriveMcollective(
'pskey', 'vhost', 'host', 'user', 'password', 'connector', 1)
'pskey', 'vhost', 'host', 'user', 'password', 'connector', 1, -1)
self.cd_scheme.common = cd_common
self.cd_scheme.puppet = cd_puppet
self.cd_scheme.mcollective = cd_mcollective

View File

@ -99,6 +99,7 @@ PROVISION_SAMPLE_DATA = {
},
"timezone": "America/Los_Angeles",
"master_ip": "10.20.0.2",
"mco_identity": -1,
"mco_enable": 1,
"mco_vhost": "mcollective",
"mco_pskey": "unset",

View File

@ -67,6 +67,7 @@ mcollective:
ttl: 4294957
securityprovider: psk
plugin.psk: {{ mcollective.pskey }}
identity: {{ mcollective.identity }}
{% if mcollective.connector == 'stomp' %}
connector = stomp
plugin.stomp.host: {{ mcollective.host }}

View File

@ -52,6 +52,7 @@ mcollective:
ttl: 4294957
securityprovider: psk
plugin.psk: {{ mcollective.pskey }}
identity: {{ mcollective.identity }}
{% if mcollective.connector == 'stomp' %}
connector = stomp
plugin.stomp.host: {{ mcollective.host }}