Newer
Older
#!/usr/bin/env python3
from subprocess import run, DEVNULL, PIPE, STDOUT
"bsd-mailx", # for "mail" command used in tester
"python3-defusedxml", # for: test_wowza
"python3-dnspython", # for: test_caches
"python3-openssl", # for: test_ssl
"python3-psutil", # for: test_wowza
"python3-psycopg2", # for: test_postgresql
"python3-pydbus", # for: test_dns_records
"python3-requests", # for: test_nginx_status, test_nginx_vhosts, test_ssl, test_apt_proxy, test_ubicast_packages_access
"python3-spf", # for: test_email
def main():
for pkg in PACKAGES:
if (
run(
["/usr/bin/dpkg", "-s", pkg],
shell=False,
stdout=DEVNULL,
stderr=DEVNULL,
stdin=PIPE,
).returncode
!= 0
):
[
"/usr/bin/apt-get",
"install",
"-q",
"-y",
pkg,
],
env={"DEBIAN_FRONTEND": "noninteractive"},
print("{} install succeeded".format(pkg))
else:
print("{} install failed".format(pkg))
else:
print("{} already installed".format(pkg))
if __name__ == "__main__":
main()