def connect(self):
try:
logging.disable(logging.WARNING)
self.fm = Foreman(self.config['auth']['url'], (self.config['auth']['user'], self.config['auth']['pass']), api_version=2, use_cache=False, strict_cache=False)
# this is nescesary for detecting faulty credentials in yaml
self.fm.architectures.index()
logging.disable(self.loglevel-1)
except:
log.log(log.LOG_ERROR, "Cannot connect to Foreman-API")
sys.exit(1)
评论列表
文章目录