diff --git a/fuel_agent/tests/test_build_utils.py b/fuel_agent/tests/test_build_utils.py index c4a1bbfc..6cb5b0d5 100644 --- a/fuel_agent/tests/test_build_utils.py +++ b/fuel_agent/tests/test_build_utils.py @@ -59,6 +59,8 @@ class BuildUtilsTestCase(unittest2.TestCase): mock_exec_expected_calls = [ mock.call('chroot', 'chroot', 'apt-get', '-y', 'update', attempts=2), + mock.call('chroot', 'chroot', 'apt-get', '-y', 'dist-upgrade', + attempts=2), mock.call('chroot', 'chroot', 'apt-get', '-y', 'install', 'package1 package2', attempts=2)] self.assertEqual(mock_exec_expected_calls, mock_exec.call_args_list) @@ -70,6 +72,8 @@ class BuildUtilsTestCase(unittest2.TestCase): mock_exec_expected_calls = [ mock.call('chroot', 'chroot', 'apt-get', '-y', 'update', attempts=2), + mock.call('chroot', 'chroot', 'apt-get', '-y', 'dist-upgrade', + attempts=2), mock.call('chroot', 'chroot', 'eatmydata', 'apt-get', '-y', 'install', 'package1 package2', attempts=2)] self.assertEqual(mock_exec_expected_calls, mock_exec.call_args_list) diff --git a/fuel_agent/utils/build.py b/fuel_agent/utils/build.py index b0672d98..8535394e 100644 --- a/fuel_agent/utils/build.py +++ b/fuel_agent/utils/build.py @@ -76,10 +76,11 @@ def run_apt_get(chroot, packages, eatmydata=False, attempts=10): dpkg/apt-get tools. It's dangerous, but could decrease package install time in X times. """ - cmds = ['chroot', chroot, 'apt-get', '-y', 'update'] - stdout, stderr = utils.execute(*cmds, attempts=attempts) - LOG.debug('Running apt-get update completed.\nstdout: %s\nstderr: %s', - stdout, stderr) + for action in ('update', 'dist-upgrade'): + cmds = ['chroot', chroot, 'apt-get', '-y', action] + stdout, stderr = utils.execute(*cmds, attempts=attempts) + LOG.debug('Running apt-get %s completed.\nstdout: %s\nstderr: %s', + action, stdout, stderr) cmds = ['chroot', chroot, 'apt-get', '-y', 'install', ' '.join(packages)] if eatmydata: cmds.insert(2, 'eatmydata')