launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #24663
[Merge] ~cjwatson/launchpad-buildd:py3-lxd-mode into launchpad-buildd:master
Colin Watson has proposed merging ~cjwatson/launchpad-buildd:py3-lxd-mode into launchpad-buildd:master.
Commit message:
Adjust X-LXD-mode header construction for Python 3
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~cjwatson/launchpad-buildd/+git/launchpad-buildd/+merge/383341
"%#o" produces "0o" prefixes on Python 3. As it happens, Go (and hence LXD) supports this form as of Go 1.13, but it's not clear that we can assume this, so force the use of plain "0" prefixes instead.
--
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad-buildd:py3-lxd-mode into launchpad-buildd:master.
diff --git a/debian/changelog b/debian/changelog
index f5e69eb..c8029fc 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -7,6 +7,7 @@ launchpad-buildd (190) UNRELEASED; urgency=medium
* Adjust tests to avoid making assumptions about dict iteration order.
* Open temporary files in text mode in more cases.
* Ensure that regex patterns with \-escapes are raw strings.
+ * Adjust X-LXD-mode header construction for Python 3.
-- Colin Watson <cjwatson@xxxxxxxxxx> Tue, 28 Apr 2020 10:19:27 +0100
diff --git a/lpbuildd/target/lxd.py b/lpbuildd/target/lxd.py
index 4fdfd33..ed1002b 100644
--- a/lpbuildd/target/lxd.py
+++ b/lpbuildd/target/lxd.py
@@ -563,7 +563,10 @@ class LXD(Backend):
headers = {
"X-LXD-uid": "0",
"X-LXD-gid": "0",
- "X-LXD-mode": "%#o" % mode,
+ # Go (and hence LXD) only supports 0o prefixes for octal
+ # numbers as of Go 1.13, and it's not clear that we can
+ # assume this. Use plain 0 prefixes instead.
+ "X-LXD-mode": "0%o" % mode if mode else "0",
}
try:
container.api.files.post(