Azure / Azure/LinuxPatchExtension

regex warnings in MsftLinuxPatchCore.py?

未关闭
#329 0 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Python
星标
12
派生
20
平均合并
6 天 4 小时
30 天内合并 PR
1

描述

**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.

贡献指南

打开贡献指南

调研方向

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

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

评估

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

把新 issue 发到你的邮箱

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