Skip to content

Instantly share code, notes, and snippets.

@gregglind
Created August 22, 2011 20:09
Show Gist options
  • Save gregglind/1163389 to your computer and use it in GitHub Desktop.
Save gregglind/1163389 to your computer and use it in GitHub Desktop.
class RoleHostsGenerator(object):
""" generator for the env.hosts dictionary"""
def __init__(self,hostfile=HOSTS_FILE):
self.hostfile=HOSTS_FILE
def __getitem__(self,key):
print self.hostfile
print key
l = list(_gethosts(key,open(self.hostfile)))
print l
return l
"""
165 gregg.lind ~/gits/commands $ fab -R web fake
/etc/hosts
0
"""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment