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:
@ -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)
|
||||
|
Reference in New Issue
Block a user