Add DEBIAN_FRONTEND=noninteractive in front of apt-get install commands
The goal is to avoid a failure of apt-get install if one of the packages tries to ask questions. Story: #2004468 Task: #28158 Change-Id: I258d5c904c29110ccdb3a7fdff5b69f489552063
This commit is contained in:
parent
2ff2d85371
commit
c4554ccd81
|
@ -551,7 +551,7 @@ class SaharaPackageValidator(SaharaImageValidatorBase):
|
||||||
|
|
||||||
def _apt_install(self, remote):
|
def _apt_install(self, remote):
|
||||||
install_cmd = (
|
install_cmd = (
|
||||||
"apt-get -y install %s" %
|
"DEBIAN_FRONTEND=noninteractive apt-get -y install %s" %
|
||||||
" ".join(str(package) for package in self.packages))
|
" ".join(str(package) for package in self.packages))
|
||||||
return _sudo(remote, install_cmd)
|
return _sudo(remote, install_cmd)
|
||||||
|
|
||||||
|
|
|
@ -262,9 +262,9 @@ class TestImages(b.SaharaTestCase):
|
||||||
except p_ex.ImageValidationError as e:
|
except p_ex.ImageValidationError as e:
|
||||||
self.assertIn("So bad!", e.message)
|
self.assertIn("So bad!", e.message)
|
||||||
self.assertEqual(remote.execute_command.call_count, 2)
|
self.assertEqual(remote.execute_command.call_count, 2)
|
||||||
calls = [mock.call("dpkg -s java-8 hadoop",
|
calls = [mock.call("dpkg -s java-8 hadoop", run_as_root=True),
|
||||||
run_as_root=True),
|
mock.call("DEBIAN_FRONTEND=noninteractive " +
|
||||||
mock.call("apt-get -y install java-8 hadoop",
|
"apt-get -y install java-8 hadoop",
|
||||||
run_as_root=True)]
|
run_as_root=True)]
|
||||||
remote.execute_command.assert_has_calls(calls)
|
remote.execute_command.assert_has_calls(calls)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue