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

Bug #1667426 reported by Mike Pontillo on 2017-02-23
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
High
Mike Pontillo
2.1
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  Edit
Everyone can see this information.

Other bug subscribers