action_utils: Drop unused progress requests from apt-get

Tests:

- All tests in patch series have been done with this patch applied
- Install and uninstall of apps works

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa 2022-09-15 07:43:19 -07:00 committed by James Valleroy
parent 5c5fc9eb61
commit 65c433a211
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808

View File

@ -405,21 +405,12 @@ def is_disk_image():
def run_apt_command(arguments):
"""Run apt-get with provided arguments."""
# Ask apt-get to output its progress to file descriptor 3.
command = [
'apt-get', '--assume-yes', '--quiet=2', '--option', 'APT::Status-Fd=3'
] + arguments
command = ['apt-get', '--assume-yes', '--quiet=2'] + arguments
# Duplicate stdout to file descriptor 3 for this process.
os.dup2(1, 3)
# Pass on file descriptor 3 instead of closing it. Close stdout
# so that regular output is ignored.
env = os.environ.copy()
env['DEBIAN_FRONTEND'] = 'noninteractive'
process = subprocess.run(command, stdin=subprocess.DEVNULL,
stdout=subprocess.DEVNULL, close_fds=False,
env=env, check=False)
stdout=subprocess.DEVNULL, env=env, check=False)
return process.returncode