mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Upgrade apt message if no python-apt to intercept potential user questions.
This commit is contained in:
parent
b9e3b053f9
commit
529a194950
1 changed files with 1 additions and 3 deletions
|
@ -31,9 +31,7 @@ APT_PATH = "/usr/bin/apt-get"
|
||||||
APT = "DEBIAN_PRIORITY=critical %s" % APT_PATH
|
APT = "DEBIAN_PRIORITY=critical %s" % APT_PATH
|
||||||
|
|
||||||
def debug(msg):
|
def debug(msg):
|
||||||
# ansible ignores stderr, so it's safe to use for debug
|
|
||||||
print >>sys.stderr, msg
|
print >>sys.stderr, msg
|
||||||
#pass
|
|
||||||
|
|
||||||
def exit_json(rc=0, **kwargs):
|
def exit_json(rc=0, **kwargs):
|
||||||
print json.dumps(kwargs)
|
print json.dumps(kwargs)
|
||||||
|
@ -46,7 +44,7 @@ def fail_json(**kwargs):
|
||||||
try:
|
try:
|
||||||
import apt
|
import apt
|
||||||
except ImportError:
|
except ImportError:
|
||||||
fail_json(msg="could not import apt")
|
fail_json(msg="could not import apt, please install the python-apt package on this host")
|
||||||
|
|
||||||
def run_apt(command):
|
def run_apt(command):
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in a new issue