regex warnings in MsftLinuxPatchCore.py?

未关闭
#329 0 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
1/5
预计耗时
1 小时以内
新手友好度
55/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
停滞
技术栈
python

调研方向

从 MsftLinuxPatchCore.py 的第 7451、7468 和 7476 行开始,然后在 Ubuntu 24.04 Azure VM 上重现该问题,同时观察扩展日志。验证受影响的 regex 处理在 LinuxPatchExtension 启动期间不再发出无效转义序列警告。

由索引模型根据 Issue 内容生成。

描述

Describe the bug
I see the following in my journalctl logs:

Aug 22 00:36:41 sr-monitor systemd[1]: Starting MsftLinuxPatchAutoAssess.service - Microsoft Azure Linux Patch Extension - Auto Assessment...
Aug 22 00:36:41 sr-monitor bash[143561]: /var/lib/waagent/Microsoft.CPlat.Core.LinuxPatchExtension-1.6.62/MsftLinuxPatchCore.py:7451: SyntaxWarning: invalid escape sequence '\_'
Aug 22 00:36:41 sr-monitor bash[143561]:   """ Fetches pid from the error message by searching for the text 'pid' and returns the process tree with all details.
Aug 22 00:36:41 sr-monitor bash[143561]: /var/lib/waagent/Microsoft.CPlat.Core.LinuxPatchExtension-1.6.62/MsftLinuxPatchCore.py:7468: SyntaxWarning: invalid escape sequence '\d'
Aug 22 00:36:41 sr-monitor bash[143561]:   regex = re.compile(' pid \d+')
Aug 22 00:36:41 sr-monitor bash[143561]: /var/lib/waagent/Microsoft.CPlat.Core.LinuxPatchExtension-1.6.62/MsftLinuxPatchCore.py:7476: SyntaxWarning: invalid escape sequence '\d'
Aug 22 00:36:41 sr-monitor bash[143561]:   regex = re.compile('\d+')

Is this a bug?

To Reproduce
Steps to reproduce the behavior:

  1. Create Azure Ubuntu VM
  2. Enable LinuxPatchExtension
  3. Watch the logs

Expected behavior
No regex warnings

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: ubuntu
  • Browser N/A
  • Version 24_04-lts

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

主要语言
Python
星标
12
派生
20
平均合并
3 天 2 小时
30 天内合并 PR
2

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

Azure/LinuxPatchExtension 的其他 Issue

查看 Azure/LinuxPatchExtension 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。