diff --git a/sahara/plugins/images.py b/sahara/plugins/images.py index 27654a47db..94719316f5 100644 --- a/sahara/plugins/images.py +++ b/sahara/plugins/images.py @@ -551,7 +551,7 @@ class SaharaPackageValidator(SaharaImageValidatorBase): def _apt_install(self, remote): install_cmd = ( - "apt-get -y install %s" % + "DEBIAN_FRONTEND=noninteractive apt-get -y install %s" % " ".join(str(package) for package in self.packages)) return _sudo(remote, install_cmd) diff --git a/sahara/tests/unit/plugins/test_images.py b/sahara/tests/unit/plugins/test_images.py index 2e93e4432d..90a6fb571c 100644 --- a/sahara/tests/unit/plugins/test_images.py +++ b/sahara/tests/unit/plugins/test_images.py @@ -262,9 +262,9 @@ class TestImages(b.SaharaTestCase): except p_ex.ImageValidationError as e: self.assertIn("So bad!", e.message) self.assertEqual(remote.execute_command.call_count, 2) - calls = [mock.call("dpkg -s java-8 hadoop", - run_as_root=True), - mock.call("apt-get -y install java-8 hadoop", + calls = [mock.call("dpkg -s java-8 hadoop", run_as_root=True), + mock.call("DEBIAN_FRONTEND=noninteractive " + + "apt-get -y install java-8 hadoop", run_as_root=True)] remote.execute_command.assert_has_calls(calls)