From 7c57f21b311b2ea394ac1984d52e62f9813eb840 2017-09-23 21:38:37 From: Lance Edgar Date: 2017-09-23 21:38:37 Subject: [PATCH] Add `force_yes` param to `fablib.apt.install()` --- diff --git a/rattail/fablib/apt.py b/rattail/fablib/apt.py index 28cd4c5c062e16f91158c0ee3b2e696464502ce5..1df2e95ba9f016c8bd1e034e8218d83c12b463cc 100644 --- a/rattail/fablib/apt.py +++ b/rattail/fablib/apt.py @@ -42,8 +42,9 @@ def install(*packages, **kwargs): frontend = kwargs.get('frontend', 'noninteractive') target = kwargs.get('target_release') target = '--target-release={}'.format(target) if target else '' - sudo('DEBIAN_FRONTEND={} apt-get --assume-yes {} install {}'.format( - frontend, target, ' '.join(packages))) + force_yes = ' --force-yes' if kwargs.get('force_yes') else '' + sudo('DEBIAN_FRONTEND={} apt-get --assume-yes {}{} install {}'.format( + frontend, target, force_yes, ' '.join(packages))) def purge(*packages):