Created
April 21, 2011 19:36
-
-
Save joshourisman/935307 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
class Server(object): | |
def __init__(self, id, name, status, public_ip, private_ip): | |
self.id = id | |
self.name = name | |
self.status = status | |
self.public_ip = public_ip | |
self.private_ip = private_ip | |
raw_list = open('servers.txt', 'r') | |
servers = [Server(*map(lambda x: x.strip(), server.strip().strip('|').split('|'))) for server in raw_list.readlines()] | |
for server in servers: | |
print """ | |
Host %s | |
User admin | |
HostName %s | |
Port 60123""" % (server.name.lower(), server.public_ip) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment