sed command in auto install fails in certain circumstance

Bug #1987859 reported by Matti Kaupenjohann
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
subiquity (Ubuntu)
Expired
Undecided
Unassigned

Bug Description

If I want to insert or append a line in the `/etc/aliases` file in the section `late-commands` from ubuntu auto-install, like the follwoing:

```
late-commands:
  - sed -i '/^postmaster:.*/i root: root' /target/etc/aliases
```

I will get the following error:

```
finish: subiquity/Late/load_autoinstall_data: {"sed -i -e '/^postmaster:.*/i\\'$'root": "root' /target/etc/aliases"} is not of type 'string', 'array'
```

From the the double quotes it seems, instead of running the complete command, the part in front of the colon will be interpreted as key. In this scenario the key:value regex seems to completly negate the single quotes of the `sed` command.

Tags: auto-install
description: updated
Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

This is just YAML being bad I think? Either of the following should work:

late-commands:
  - |
    sed -i '/^postmaster:.*/i root: root' /target/etc/aliases
  - - sed
    - -i
    - "/^postmaster:.*/i root: root"
    - /target/etc/aliases

Dan Bungert (dbungert)
Changed in subiquity (Ubuntu):
status: New → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for subiquity (Ubuntu) because there has been no activity for 60 days.]

Changed in subiquity (Ubuntu):
status: Incomplete → Expired
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.