#NEWLINE# def _get_master_estate_name( self , clustered = False ) : #NEWLINE# #INDENT# '\n        Assign and return the name of the estate for the default master or empty if none\n        If the default master is no longer available then selects one of the available\n        masters\n        ' #NEWLINE# opts = self . opts . value #NEWLINE# master = self . road_stack . value . nameRemotes . get ( self . master_estate_name . value ) #NEWLINE# if ( ( not master ) or ( not master . alived ) ) : #NEWLINE# #INDENT# available_masters = [ remote for remote in list ( self . road_stack . value . remotes . values ( ) ) if remote . alived ] #NEWLINE# if available_masters : #NEWLINE# #INDENT# random_master = opts . get ( 'random_master' ) #NEWLINE# if random_master : #NEWLINE# #INDENT# master = available_masters [ random . randint ( 0 , ( len ( available_masters ) - 1 ) ) ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# master = available_masters [ 0 ] #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# master = None #NEWLINE# #UNINDENT# #UNINDENT# self . master_estate_name . value = ( master . name if master else '' ) #NEWLINE# return self . master_estate_name . value