BUG 反馈
#703
Replies: 1 comment
-
已修复,mw update_dev 即可 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
问题描述
在更新或重装面板时候会触发报错:
错误是
IndexError: list index out of range
,发生在firewall.py
文件的aIF_Ufw()
方法中,具体代码是:pinfo.split('/')
结果可能只有一个元素(即info
只有info[0]
,没有info[1]
),导致info[1]
访问超出范围。排查:
从
aIF_Ufw
代码逻辑来看,pinfo
只有一个元素的原因很可能是ufw status
命令的输出格式导致awk
处理后的结果不符合预期。关键代码
手动执行
ufw status|awk '{print $1}' | grep -v 'Status'|grep -v 'To'|grep -v '-'
ufw status
的输出是:发现输出的第一行为空行导致报错。
可能的修复方案
ufw status
输出中的空行ufw status
时,改用:ufw status
自带的空行和冗余信息。Beta Was this translation helpful? Give feedback.
All reactions