Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/usr/bin/env python
import socket
grains = {}
REDIS_MASTER = 'redis_master.hostname.com'
def redis_master():
try:
REDIS_M_INFO = socket.gethostbyaddr(REDIS_MASTER)
redis_ip = REDIS_M_INFO[2][0]
except socket.gaierror:
return False
grains['redis_master'] = redis_ip
return grains
if __name__ == '__main__':
redis_master()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.