python - Pyhaproxy 作业在“前端”定义中给出未指定主机和端口
问题描述
我的 pyhaproxy 脚本有一个小问题,我希望你能引导我走向正确的方向。
我的 haproxy.cfg 包含两个前端...
frontend http
bind 0.0.0.0:80
acl test_site1 hdr(host) -i test_site1.local
use_backend test_site1_back if test_site1
etc. etc.
frontend https
bind 0.0.0.0:443 ssl crt /etc/ssl/private
option forwardfor
reqadd X-Forwarded-Proto:\ https
acl test_site1 hdr(host) -i test_site1.local
use_backend test_site1_back if test_site1
etc. etc.
haproxy 工作得很好——那里没问题。
我的 pyhaproxy 清理脚本的一部分如下所示:
haproxy_cfg = '/etc/haproxy.cfg'
haproxy_bak = '/etc/haproxy.bak'
parser = Parser(haproxy_cfg)
configuration = parser.build_configuration()
frontends = configuration.frontends
backends = configuration.backends
它给出以下错误消息:[第 287 行是配置 = parser.build_configuration()]
Traceback(最近一次调用最后一次):文件“./cleaner.py”,第 287 行,在 configuration = parser.build_configuration()
文件“/a-lot-of-folders/python2.7/site-packages/pyhaproxy/parse.py”,第 41 行,在 build_configuration
self.build_frontend(section_node))
文件“/a-lot-of-folders/python2.7/site-packages/pyhaproxy/parse.py”,第 203 行,在 build_frontend
frontend
'未在定义中指定主机和端口')
frontend
例外:未在定义中指定主机和端口分段故障
我做错了什么或错过了什么?
问候 - 拉斯
解决方案
推荐阅读
- visual-studio-code - 如何从 Visual Studio Code 在 GitLab 页面上编写文档?
- sql - 从两列上具有重复值的行中获取 ID,以便稍后更新它们
- c++ - 在 While 循环中间抛出 Std::bad_alloc
- java - 从房间数据库中删除项目 Kotlin
- asp.net - ASP 按钮的生命周期是什么?
- laravel - laravel 如何使用自定义保护名称 Auth::atemnt()
- apache2 - 每当我尝试检查其状态时出现 apache AHOO526 错误
- python - 从列表中删除整个列表
- java - 替换所有字符串 int java 源代码
- python - 如何禁用特定文件的 pylint 错误消息?