Merge ~mitchdz/ubuntu/+source/hibagent:mitch/noble-imdsv2-fix-proposed into ubuntu/+source/hibagent:ubuntu/devel

Proposed by Mitchell Dzurick
Status: Merged
Merge reported by: Mitchell Dzurick
Merged at revision: 1c9f5324f4ed63a3aeb9cc958c5c64665d7f8c25
Proposed branch: ~mitchdz/ubuntu/+source/hibagent:mitch/noble-imdsv2-fix-proposed
Merge into: ubuntu/+source/hibagent:ubuntu/devel
Diff against target: 52 lines (+30/-0)
3 files modified
debian/changelog (+7/-0)
debian/patches/hibagent-test-use-importlib.patch (+22/-0)
debian/patches/series (+1/-0)
Reviewer Review Type Date Requested Status
Bryce Harrington (community) Approve
git-ubuntu import Pending
Review via email: mp+455922@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Bryce Harrington (bryce) wrote :

This was already uploaded by Seth, this MP should be updated or closed.

Btw, when making DEP3 metadata for a patch, multi-line Descriptions should have subsequent lines indented to column 2.

Also, if the fix is appropriate for Debian and/or upstream, it should be forwarded and noted in the metadata; if it's not worth forwarding, that is also worth mentioning with the reason why.

review: Approve
Revision history for this message
Mitchell Dzurick (mitchdz) wrote :

Thanks Bryce! I was just about to go around and close my MPs.

There is no debian package, and these commits come directly from upstream.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index c056326..f99cc6b 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,10 @@
6+hibagent (1.0.1+git20230216.9ac1209f7-0ubuntu3) noble; urgency=medium
7+
8+ * d/p/hibagent-test-use-importlib.patch: use importlib in
9+ test/hibagent_test.py as imp was removed in python3.12 (LP: #2044029).
10+
11+ -- Mitchell Dzurick <mitchell.dzurick@canonical.com> Mon, 20 Nov 2023 15:51:14 -0700
12+
13 hibagent (1.0.1+git20230216.9ac1209f7-0ubuntu2) noble; urgency=medium
14
15 * d/p/do-nothing-if-ODH-is-configured.patch: do nothing if ODH is configured,
16diff --git a/debian/patches/hibagent-test-use-importlib.patch b/debian/patches/hibagent-test-use-importlib.patch
17new file mode 100644
18index 0000000..2469a23
19--- /dev/null
20+++ b/debian/patches/hibagent-test-use-importlib.patch
21@@ -0,0 +1,22 @@
22+Description: use importlib instead of imp
23+In python3.12, imp is removed. importlib is the replacement.
24+Author: Mitchell Dzurick <mitchell.dzurick@canonical.com>
25+Last-Update: 2023-11-20
26+---
27+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
28+--- a/test/hibagent_test.py
29++++ b/test/hibagent_test.py
30+@@ -7,10 +7,11 @@
31+ from tempfile import mktemp
32+ from threading import Thread
33+
34+-import imp
35++import importlib.machinery
36+ agent_file = os.path.dirname(os.path.abspath(__file__))+"/../../../../agent/hibagent"
37+ with open(agent_file) as fl:
38+- hibagent = imp.load_module('hibagent', fl, agent_file, ('py', 'rb', 1))
39++ loader = importlib.machinery.SourceFileLoader('hibagent', agent_file)
40++ hibagent = loader.load_module()
41+
42+ from time import sleep
43+
44diff --git a/debian/patches/series b/debian/patches/series
45index 0b9774f..f519cd6 100644
46--- a/debian/patches/series
47+++ b/debian/patches/series
48@@ -10,3 +10,4 @@ fix-enable-ec2-spot-hibernation.patch
49 setuptools-fix-package-discovery.patch
50 disable-hibernate-test.patch
51 do-nothing-if-ODH-is-configured.patch
52+hibagent-test-use-importlib.patch

Subscribers

People subscribed via source and target branches