Azure / Azure/LinuxPatchExtension

regex warnings in MsftLinuxPatchCore.py?

オープン
#329 コメント 0 件 リアクション 1 件 担当者 0 名 GitHub で見る
主要言語
Python
スター
12
フォーク
20
平均マージ
6日 4時間
マージ済み PR(30日)
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 を短くまとめたダイジェスト。