Merge "IBP: image build: disable startup of puppet"
This commit is contained in:
commit
c936d8a794
|
@ -166,10 +166,12 @@ class BuildUtilsTestCase(testtools.TestCase):
|
|||
def test_do_post_inst(self, mock_exec, mock_files, mock_clean, mock_path):
|
||||
mock_path.join.return_value = 'fake_path'
|
||||
bu.do_post_inst('chroot')
|
||||
mock_exec.assert_called_once_with(
|
||||
'sed', '-i', 's%root:[\*,\!]%root:$6$IInX3Cqo$5xytL1VZbZTusO'
|
||||
'ewFnG6couuF0Ia61yS3rbC6P5YbZP2TYclwHqMq9e3Tg8rvQxhxSlBXP1DZ'
|
||||
'hdUamxdOBXK0.%', 'fake_path')
|
||||
mock_exec_expected_calls = [
|
||||
mock.call('sed', '-i', 's%root:[\*,\!]%root:$6$IInX3Cqo$5xytL1VZb'
|
||||
'ZTusOewFnG6couuF0Ia61yS3rbC6P5YbZP2TYclwHqMq9e3Tg8rvQx'
|
||||
'hxSlBXP1DZhdUamxdOBXK0.%', 'fake_path'),
|
||||
mock.call('chroot', 'chroot', 'update-rc.d', 'puppet', 'disable')]
|
||||
self.assertEqual(mock_exec_expected_calls, mock_exec.call_args_list)
|
||||
mock_files.assert_called_once_with('chroot', ['usr/sbin/policy-rc.d'])
|
||||
mock_clean.assert_called_once_with('chroot')
|
||||
mock_path.join.assert_called_once_with('chroot', 'etc/shadow')
|
||||
|
|
|
@ -178,6 +178,14 @@ def do_post_inst(chroot):
|
|||
utils.execute('sed', '-i',
|
||||
's%root:[\*,\!]%root:' + ROOT_PASSWORD + '%',
|
||||
os.path.join(chroot, 'etc/shadow'))
|
||||
# NOTE(agordeev): backport from bash-script:
|
||||
# in order to prevent the later puppet workflow outage, puppet service
|
||||
# should be disabled on a node startup.
|
||||
# Being enabled by default, sometimes it leads to puppet service hanging
|
||||
# and recognizing the deployment as failed.
|
||||
# TODO(agordeev): take care of puppet service for other distros, once
|
||||
# fuel-agent will be capable of building images for them too.
|
||||
utils.execute('chroot', chroot, 'update-rc.d', 'puppet', 'disable')
|
||||
# NOTE(agordeev): remove custom policy-rc.d which is needed to disable
|
||||
# execution of post/pre-install package hooks and start of services
|
||||
remove_files(chroot, ['usr/sbin/policy-rc.d'])
|
||||
|
|
Loading…
Reference in New Issue