Skip to content

Instantly share code, notes, and snippets.

@drohr
Created September 26, 2012 09:20
Show Gist options
  • Save drohr/3786979 to your computer and use it in GitHub Desktop.
Save drohr/3786979 to your computer and use it in GitHub Desktop.
get fabric role from ip
def _get_role(ip):
role = [k for k, v in env.roledefs.iteritems() if ip in v]
return role[0]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment