def trusted_ticket_test(): """Test ability to generate a trusted ticket from Tableau Server""" # test for ability to generate a trusted ticket with the general username provided if config.configs['trusted.useclientip']: clientip = config.configs['trusted.clientip'] else: clientip = None log.logger.debug(u'testing trusted ticket: {}, {}, {}, {}'.format( config.configs['server'], config.configs['server.user'], config.configs['server.user.domain'], clientip)) sitename = '' # this is just a test, use the default site test_ticket = None try: test_ticket = tabhttp.get_trusted_ticket( config.configs['server'], sitename, config.configs['server.user'], config.configs['server.ssl'], config.configs['server.certcheck'], config.configs['server.certfile'], config.configs['server.user.domain'], clientip) log.logger.debug(u'Generated test trusted ticket. Value is: {}'.format(test_ticket)) except Exception as e: errormessage = e.message log.logger.error(errormessage) quit_script(errormessage)