diff options
author | Jonah BrĂ¼chert <jbb@kaidan.im> | 2024-04-16 17:32:42 +0200 |
---|---|---|
committer | Jonah BrĂ¼chert <jbb@kaidan.im> | 2024-04-16 18:41:34 +0200 |
commit | 15f2aab7f1053a46d6d87a7c7f193767516c16cc (patch) | |
tree | b8a11a33bfed2625b688f83ad6d7be7d362807a2 /bin | |
parent | e35a1ac2926b22ae412636a6ac6090741d6cbc01 (diff) | |
download | tools-15f2aab7f1053a46d6d87a7c7f193767516c16cc.tar.gz tools-15f2aab7f1053a46d6d87a7c7f193767516c16cc.tar.bz2 tools-15f2aab7f1053a46d6d87a7c7f193767516c16cc.zip |
2to3
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/hostinfo | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/bin/hostinfo b/bin/hostinfo index 8700be7..a97a8d8 100755 --- a/bin/hostinfo +++ b/bin/hostinfo @@ -110,7 +110,7 @@ def print_search(basepath, flags, search, filter_key=None): key, result = _match(data, search_key, search_value, negate) if result is not None: if flags.only_names: - print(_get_label(host)) + print((_get_label(host))) continue p = printer.Printer(data, flags) @@ -119,7 +119,7 @@ def print_search(basepath, flags, search, filter_key=None): maxlength=max(length), force=True) else: if key is None: - print(_get_label(host)) + print((_get_label(host))) else: p.info(key, label=_get_label(host), maxlength=max(length), force=True) @@ -134,15 +134,15 @@ def print_keys(path): if isinstance(data, str): return - for key in data.keys(): - print "%s%s" % (prefix, key) + for key in list(data.keys()): + print("%s%s" % (prefix, key)) if key == 'addresses': - for k in utils.group_by(data[key], 'interface').keys(): - print "%s%s.%s" % (prefix, key, k) + for k in list(utils.group_by(data[key], 'interface').keys()): + print("%s%s.%s" % (prefix, key, k)) elif key == 'ports': - for k in utils.group_by(data[key], 'process', 'UNKNOWN').keys(): - print "%s%s.%s" % (prefix, key, k) + for k in list(utils.group_by(data[key], 'process', 'UNKNOWN').keys()): + print("%s%s.%s" % (prefix, key, k)) elif isinstance(data[key], dict): _print_keys(data[key], "%s%s." % (prefix, key)) elif isinstance(data[key], list): @@ -159,7 +159,7 @@ def print_hosts(path, short): if 'hosts' in hosts: for host in hosts['hosts']: if short: - print(host.replace('.spline.inf.fu-berlin.de','')) + print((host.replace('.spline.inf.fu-berlin.de',''))) else: print(host) return True @@ -202,7 +202,7 @@ def print_version_and_exit(): if ver is None: sys.stderr.write('Unable to identify the version information.') sys.exit(1) - print("hostinfo-tools %s" % ver) + print(("hostinfo-tools %s" % ver)) sys.exit(0) def main(): |