diff options
author | Jonathan Cave <jonathan.cave@canonical.com> | 2020-07-28 18:37:03 +0100 |
---|---|---|
committer | Jonathan Cave <jonathan.cave@canonical.com> | 2020-07-30 14:20:05 +0100 |
commit | d860c0e4b7795c4f1fc9dff2c129434b8e8276f9 (patch) | |
tree | 753550d8e7b1cf2c0bb87c482d94502b952df238 /bin | |
parent | 6a157f7a7ec302fb4cb4cc186ecb74c263f5a571 (diff) |
units/*: remove use of zenity dialogs
Modify any jobs still using zenity dialogs to only display the information on the command line
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/network_check.py | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/bin/network_check.py b/bin/network_check.py index 20b88d5..c34ac6c 100755 --- a/bin/network_check.py +++ b/bin/network_check.py @@ -3,7 +3,6 @@ Check that it's possible to establish a http connection against ubuntu.com """ -from subprocess import call from argparse import ArgumentParser import http.client import urllib.request @@ -51,20 +50,11 @@ def main(): % dict([(protocol, bool2str[value]) for protocol, value in results.items()])) - command = ["zenity", "--title=Network", - "--text=%s" % message] - - if all(results.values()): - command.append("--info") - else: - command.append("--error") - if not args.auto: - try: - call(command) - except OSError: - print( - "Zenity missing; unable to report test result:\n %s" % message) + if all(results.values()): + print(message) + else: + print(message, file=sys.stderr) if any(results.values()): return 0 |