[2.x] Failure to render drivers.yaml apt key in curtin_userdata

Bug #1667426 reported by Mike Pontillo
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Fix Released
High
Mike Pontillo
2.1
Won't Fix
Medium
Mike Pontillo

Bug Description

When we go to render the a preseed containing a custom driver, we have the following code in the template:

    {{py: key_string = ''.join(['\\x%x' % x for x in map(ord, driver['key_binary'])])}}

As of Python 3, driver['key_binary'] is a binary string, not a text string, and so ord() causes a crash. What we really need is:

    {{py: key_string = ''.join(['\\x%x' % x for x in driver['key_binary']])}}

Workaround: edit /etc/maas/preseeds/curtin_userdata and modify the aforementioned line of code.

Related branches

Changed in maas:
milestone: none → 2.2.0
assignee: nobody → Mike Pontillo (mpontillo)
summary: - [2.x] Custom driver support has been broken since the move to Python 3
+ [2.x] drivers.yaml rendering in curtin_userdata crashes when rendering
+ apt key
summary: - [2.x] drivers.yaml rendering in curtin_userdata crashes when rendering
- apt key
+ [2.x] Failure to render drivers.yaml apt key in curtin_userdata
Changed in maas:
status: Triaged → Fix Committed
Changed in maas:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.