(config, logger)
return queue_manager
Get the connection either with a username and password or without
Get the connection either with a username and password or without
Get the connection either with a username and password or without
def get_normal_connection(config, logger):
    # type: (IBMMQConfig, CheckLoggingAdapter) -> pymqi.QueueManager
    """
    Get the connection either with a username and password or without
    """
    channel_definition = _get_channel_definition(config)
    queue_manager = pymqi.QueueManager(None)

    if config.username and config.password:
        logger.debug("connecting with username and password")

        kwargs = {'user': config.username, 'password': config.password, 'cd': channel_definition}

        queue_manager.connect_with_options(config.queue_manager_name, **kwargs)
    else:
        logger.debug("connecting without a username and password")
        queue_manager.connect_with_options(config.queue_manager_name, channel_definition)
    return queue_manager
def get_normal_connection ( config , logger ) : # type: (IBMMQConfig, CheckLoggingAdapter) -> pymqi.QueueManager channel_definition = _get_channel_definition ( config ) queue_manager = pymqi . QueueManager ( None ) if config . username and config . password : logger . debug ( "connecting with username and password" ) kwargs = { 'user' : config . username , 'password' : config . password , 'cd' : channel_definition } queue_manager . connect_with_options ( config . queue_manager_name , * * kwargs ) else : logger . debug ( "connecting without a username and password" ) queue_manager . connect_with_options ( config . queue_manager_name , channel_definition ) return queue_manager