def getManagerCorbaloc(new_corbaloc=None): ''' Get (or set) managers corbaloc. Params: If the developer specifies a value other than None for new_corbaloc, it is assumed this is managers corbaloc and sets it accordingly. Returns: the stringified corbaloc of manager. Raises: Nothing. ''' global MGR_CORBALOC if new_corbaloc != None: #Developer is trying to manually set the singled reference. MGR_CORBALOC = str(new_corbaloc) elif MGR_CORBALOC == None: #If this function has never been called before... #Check command-line args for the corbaloc for i in range(0, len(argv) - 1): if argv[i] == '-managerReference': #Found it! OK to set now. MGR_CORBALOC = argv[i + 1] break if MGR_CORBALOC == None: #Not in the command-line so check an environment variable reference if environ.has_key('MANAGER_REFERENCE'): #Found it! OK to set now. MGR_CORBALOC = environ['MANAGER_REFERENCE'] else: #Assume manager is running under the local machine MGR_CORBALOC = 'corbaloc::' + str( getIP()) + ':' + getManagerPort() + '/Manager' return MGR_CORBALOC
def getManagerCorbaloc(new_corbaloc=None): """ Get (or set) managers corbaloc. Params: If the developer specifies a value other than None for new_corbaloc, it is assumed this is managers corbaloc and sets it accordingly. Returns: the stringified corbaloc of manager. Raises: Nothing. """ global MGR_CORBALOC if new_corbaloc != None: # Developer is trying to manually set the singled reference. MGR_CORBALOC = str(new_corbaloc) elif MGR_CORBALOC == None: # If this function has never been called before... # Check command-line args for the corbaloc for i in range(0, len(argv) - 1): if argv[i] == "-managerReference" or argv[i] == "-m": # Found it! OK to set now. MGR_CORBALOC = argv[i + 1] break if MGR_CORBALOC == None: # Not in the command-line so check an environment variable reference if environ.has_key("MANAGER_REFERENCE"): # Found it! OK to set now. MGR_CORBALOC = environ["MANAGER_REFERENCE"] else: # Assume manager is running under the local machine MGR_CORBALOC = "corbaloc::" + str(getIP()) + ":" + getManagerPort() + "/Manager" return MGR_CORBALOC
""" from AcsutilPy.ACSPorts import getBasePort from AcsutilPy.ACSPorts import getManagerPort from AcsutilPy.ACSPorts import getNamingServicePort from AcsutilPy.ACSPorts import getNotifyServicePort from AcsutilPy.ACSPorts import getLoggingServicePort from AcsutilPy.ACSPorts import getIRPort from AcsutilPy.ACSPorts import getLogPort from AcsutilPy.ACSPorts import getCDBPort from AcsutilPy.ACSPorts import getContainerDaemonPort from AcsutilPy.ACSPorts import getServicesDaemonPort from AcsutilPy.ACSPorts import getIP ############################################################################### # Test code if __name__ == "__main__": # basically just make sure none of these throw exceptions because multiple values # are actually correct here! print type(getBasePort()) print type(getManagerPort()) print type(getNamingServicePort()) print type(getNotifyServicePort()) print type(getLoggingServicePort()) print type(getIRPort()) print type(getLogPort()) print type(getCDBPort()) print type(getContainerDaemonPort()) print type(getServicesDaemonPort()) print type(getIP())