Skip to content

Instantly share code, notes, and snippets.

@joshourisman
Created April 21, 2011 19:36
Show Gist options
  • Save joshourisman/935307 to your computer and use it in GitHub Desktop.
Save joshourisman/935307 to your computer and use it in GitHub Desktop.
#!/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