Commissioning script with CRLF line break is failing

Bug #1852765 reported by Vladimir Grevtsev
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Fix Released
High
Lee Trager

Bug Description

tl;dr: commissioning script will fail if it's using CRLF instead of LF line break.

Steps to reproduce:

1. Ensure we have two files, first with CRLF, second with LF:

vgrevtsev@austin-macbook:/Users/vgrevtsev/Desktop $ dos2unix -idu *.sh
      11 0 test-crlf.sh
       0 11 test-lf.sh

The scripts are almost equal to each other, except of the script metadata: https://pastebin.canonical.com/p/8b7qq8DtNY/

2. Upload them to the MAAS via UI
3. Try to commission the machine
4. test-lf will pass, test-crlf will fail:

$ maas admin node-script-result update 6wbc4m current-commissioning filters=00-maas-01-crlf suppressed=False
$ maas admin node-script-results read 6wbc4m include_output=true | pastebinit
http://paste.ubuntu.com/p/yggXSCvvwq/

$ echo "W0Vycm5vIDJdIE5vIHN1Y2ggZmlsZSBvciBkaXJlY3Rvcnk6ICcvdG1wL3VzZXJfZGF0YS5zaC5IbjRJelYvc2NyaXB0cy9jb21taXNzaW9uaW5nLzAwLW1hYXMtMDEtY3JsZic6ICcvdG1wL3VzZXJfZGF0YS5zaC5IbjRJelYvc2NyaXB0cy9jb21taXNzaW9uaW5nLzAwLW1hYXMtMDEtY3JsZic=" | base64 -d
[Errno 2] No such file or directory: '/tmp/user_data.sh.Hn4IzV/scripts/commissioning/00-maas-01-crlf': '/tmp/user_data.sh.Hn4IzV/scripts/commissioning/00-maas-01-crlf'

Related branches

Changed in maas:
status: New → Triaged
importance: Undecided → High
assignee: nobody → Lee Trager (ltrager)
Revision history for this message
Lee Trager (ltrager) wrote :

The attached branch will automatically convert any script uploaded to MAAS LF(Unix).

Changed in maas:
status: Triaged → In Progress
milestone: none → 2.7.0alpha1
Changed in maas:
milestone: 2.7.0b1 → 2.7.0b2
Changed in maas:
status: In Progress → 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.