#NEWLINE# def _GetHostnameMock( cfg , mock_fct , name = None , family = None ) : #NEWLINE# #INDENT# if _IsOverwrittenReturnValue ( mock_fct . return_value ) : #NEWLINE# #INDENT# return mock . DEFAULT #NEWLINE# #UNINDENT# if ( name is None ) : #NEWLINE# #INDENT# name = cfg . GetMasterNodeName ( ) #NEWLINE# #UNINDENT# if ( name == cfg . GetClusterName ( ) ) : #NEWLINE# #INDENT# cluster = cfg . GetClusterInfo ( ) #NEWLINE# return HostnameMock ( cluster . cluster_name , cluster . master_ip ) #NEWLINE# #UNINDENT# node = cfg . GetNodeInfoByName ( name ) #NEWLINE# if ( node is not None ) : #NEWLINE# #INDENT# return HostnameMock ( node . name , node . primary_ip ) #NEWLINE# #UNINDENT# return HostnameMock ( name , '203.0.113.253' )