1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-06-19 00:17:51 +02:00

add host to objects

This commit is contained in:
Kelly Brazil
2023-01-21 17:00:22 -08:00
parent 0648d2e9e3
commit 2a148d44a1

View File

@ -87,7 +87,9 @@ def parse(
if jc.utils.has_data(data):
myconfig = sshconfig.from_text(data)
hostnames = myconfig.get_hostnames()
hostnames = sorted(myconfig.get_hostnames())
raw_output = [myconfig.lookup(x) for x in hostnames]
for host, obj in zip(hostnames, raw_output.copy()):
obj.update({'host': host})
return raw_output if raw else _process(raw_output)