diff options
Diffstat (limited to 'bin/hostinfo')
-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(): |