netplan generate error message points to the wrong line number

Bug #1752956 reported by Ryan Harper
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
nplan (Ubuntu)
In Progress
Medium
Mathieu Trudel-Lapierre

Bug Description

1.
root@b2:~# lsb_release -rd
Description: Ubuntu Bionic Beaver (development branch)
Release: 18.04

root@b2:~# cat /etc/cloud/build.info
build_name: server
serial: 20180224

2.
root@b2:~# apt-cache policy nplan
nplan:
  Installed: 0.33
  Candidate: 0.33
  Version table:
 *** 0.33 500
        500 http://archive.ubuntu.com/ubuntu bionic/main amd64 Packages
        100 /var/lib/dpkg/status

3. netplan generate detects invalid config, in error message reports the line and column correctly to where the error was found.

4. netplan generate reports an error, but the location isn't accurate.

root@b2:~# cat /etc/netplan/50-cloud-init.yaml
# This file is generated from information provided by
# the datasource. Changes to it will not persist across an instance.
# To disable cloud-init's network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
network:
    version: 2
    ethernets:
        eth0:
            dhcp4: true
            mtu: 1501
            addresses:
            - 2001:4800:78ff:1b:be76:4eff:fe06:96b3/64
    bridges:
        br0:
            addresses: []
            accept-ra: true

vlans:
  vlan.45:
     id: 45
     link: eth0

root@b2:~# netplan generate
Error in network definition //etc/netplan/50-cloud-init.yaml line 5 column 0: unknown key vlans

ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: nplan 0.33
ProcVersionSignature: Ubuntu 4.13.0-32.35~16.04.1-generic 4.13.13
Uname: Linux 4.13.0-32-generic x86_64
ApportVersion: 2.20.8-0ubuntu10
Architecture: amd64
Date: Fri Mar 2 18:51:49 2018
ProcEnviron:
 TERM=xterm-256color
 PATH=(custom, no user)
 LANG=C.UTF-8
SourcePackage: nplan
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Ryan Harper (raharper) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in nplan (Ubuntu):
status: New → Confirmed
Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :
Changed in nplan (Ubuntu):
status: Confirmed → In Progress
importance: Undecided → Medium
assignee: nobody → Mathieu Trudel-Lapierre (cyphermox)
Revision history for this message
Thiago Vincenzi Conrado (tconrado) wrote :

I have similar issue, and it got ok after setting the same column alignment for the keyword of ethernets

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.