#NEWLINE# def registerMachine( self , component_names , ttl = 60 ) : #NEWLINE# #INDENT# ' Registers this machine with etcd. ' #NEWLINE# machine_state = { #NEWLINE# #INDENT# 'status' : STATUS_RUNNING , #NEWLINE# 'components' : self , #NEWLINE# 'ip' : socket . gethostbyname ( socket . gethostname ( ) ) , #NEWLINE# #UNINDENT# } #NEWLINE# self . setState ( machine_state , ttl = ttl )