From 6cf17a054b5c4833de55003c5903bc62f6204b73 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Fri, 18 Sep 2020 15:38:20 -0500 Subject: [PATCH] Pass arbitrary kwargs along, for `apt.install()` also return the result --- rattail_fabric2/apt.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/rattail_fabric2/apt.py b/rattail_fabric2/apt.py index 6f65a46..a4e97dc 100644 --- a/rattail_fabric2/apt.py +++ b/rattail_fabric2/apt.py @@ -36,12 +36,12 @@ def install(c, *packages, **kwargs): """ Install one or more packages via ``apt-get install``. """ - frontend = kwargs.get('frontend', 'noninteractive') - target = kwargs.get('target_release') + frontend = kwargs.pop('frontend', 'noninteractive') + target = kwargs.pop('target_release', None) target = '--target-release={}'.format(target) if target else '' - force_yes = ' --force-yes' if kwargs.get('force_yes') else '' - c.sudo('DEBIAN_FRONTEND={} apt-get --assume-yes {}{} install {}'.format( - frontend, target, force_yes, ' '.join(packages))) + force_yes = ' --force-yes' if kwargs.pop('force_yes', False) else '' + return c.sudo('DEBIAN_FRONTEND={} apt-get --assume-yes {}{} install {}'.format( + frontend, target, force_yes, ' '.join(packages)), **kwargs) def purge(c, *packages):