diff --git a/src/main.py b/src/main.py index 7887483..d6e79e2 100644 --- a/src/main.py +++ b/src/main.py @@ -126,7 +126,7 @@ def parse_yaml(data): def to_ssh_config_string(parse): s = str() - for host, keys in parse.items(): + for i, (host, keys) in enumerate(parse.items()): lines = list() for key, values in keys.items(): @@ -137,7 +137,9 @@ def to_ssh_config_string(parse): lines.append(f"\t{key} {value}") # join the sorted lines on a new line character - s += f"Host {host}\n" + "\n".join(sorted(lines)) + "\n\n" + s += f"Host {host}\n" + "\n".join(sorted(lines)) + + s += "\n\n" if i < len(parse) - 1 else "\n" return s