Merge autopkgtest-cloud:dotall into autopkgtest-cloud:master

Proposed by Brian Murray
Status: Merged
Merged at revision: cb2f798ce8f0bdc3da00ac9f392d919c33abf95e
Proposed branch: autopkgtest-cloud:dotall
Merge into: autopkgtest-cloud:master
Diff against target: 13 lines (+1/-1)
1 file modified
charms/focal/autopkgtest-cloud-worker/autopkgtest-cloud/tools/filter-amqp (+1/-1)
Reviewer Review Type Date Requested Status
Canonical's Ubuntu QA Pending
Review via email: mp+446336@code.launchpad.net

Description of the change

The queue items in amqp contain a '\n' in them so using a regex of "debvm.*openssh" will not match without this fix. While you could expand the regex to "debvm\n.*openssh" that seems easy to forget.

Before the change:

./filter-amqp --dry-run debci-huge-mantic-arm64 "debvm.*openssh"

After the change:

./filter-amqp --dry-run debci-huge-mantic-arm64 "debvm.*openssh"
2023-07-07 20:23:38,640 - queue item: b'debvm{"triggers": ["openssh/1:9.3p1-1ubuntu1"], "submit-time": "2023-07-06 18:53:33"}' (would delete)

To post a comment you must log in.
Revision history for this message
Brian Murray (brian-murray) wrote :

And of course this is cowboy'ed on one of the autopkgtest-cloud-worker units.

Revision history for this message
Tim Andersson (andersson123) wrote :

I agree, shouldn't have to remember to put newlines in a regex.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/charms/focal/autopkgtest-cloud-worker/autopkgtest-cloud/tools/filter-amqp b/charms/focal/autopkgtest-cloud-worker/autopkgtest-cloud/tools/filter-amqp
2index 76e51ca..2aba358 100755
3--- a/charms/focal/autopkgtest-cloud-worker/autopkgtest-cloud/tools/filter-amqp
4+++ b/charms/focal/autopkgtest-cloud-worker/autopkgtest-cloud/tools/filter-amqp
5@@ -11,7 +11,7 @@ import amqplib.client_0_8 as amqp
6
7 def filter_amqp(options, host, queue_name, regex):
8 url_parts = urllib.parse.urlsplit(host, allow_fragments=False)
9- filter_re = re.compile(regex.encode("UTF-8"))
10+ filter_re = re.compile(regex.encode("UTF-8"), re.DOTALL)
11 amqp_con = amqp.Connection(
12 url_parts.hostname,
13 userid=url_parts.username,

Subscribers

People subscribed via source and target branches