netplan backported on bionic (0.40~18.04.1) crash when there is an empty YAML configuration file
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Netplan |
Confirmed
|
Undecided
|
Unassigned | ||
netplan.io (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Bionic |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
[Impact]
Any Netplan user leaving empty files in /etc/netplan.
[Test case]
1) put a valid configuration under /etc/netplan/
2) create an empty YAML file /etc/netplan/
3) execute netplan apply
Validate that 'netplan apply' does not crash, and correctly applies the configuration.
[Regression potential]
Watch out for issues in merging netplan configuration or evaluating the parts of configuration that can't be reverted safely, for the use of 'netplan try'.
---
Traceback (most recent call last):
File "/usr/sbin/
netplan.main()
File "/usr/share/
self.
File "/usr/share/
self.func()
File "/usr/share/
self.
File "/usr/share/
self.func()
File "/usr/share/
config_
File "/usr/share/
self.
File "/usr/share/
network = yaml_data.
AttributeError: 'NoneType' object has no attribute 'get'
Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/lib/
os.O_WRONLY | os.O_CREAT | os.O_EXCL, 0o640), 'wb') as f:
FileNotFoundError: [Errno 2] No such file or directory: '/var/crash/
Original exception was:
Traceback (most recent call last):
File "/usr/sbin/
netplan.main()
File "/usr/share/
self.
File "/usr/share/
self.func()
File "/usr/share/
self.
File "/usr/share/
self.func()
File "/usr/share/
config_
File "/usr/share/
self.
File "/usr/share/
network = yaml_data.
AttributeError: 'NoneType' object has no attribute 'get'
This is a regression with the previous version.
apt policy netplan.io
netplan.io:
Installé : 0.40~18.04.1
Candidat : 0.40~18.04.1
Table de version :
*** 0.40~18.04.1 500
500 http://
100 /var/lib/
0.36.3 500
500 http://
0.36.1 500
500 http://
Distributor ID: Ubuntu
Description: Ubuntu 18.04.1 LTS
Release: 18.04
Codename: bionic
description: | updated |
description: | updated |
description: | updated |
Changed in netplan.io (Ubuntu Bionic): | |
status: | Fix Released → Fix Committed |
status: | Fix Committed → Fix Released |
I can reproduce the failure as well after upgrading to netplan.io in proposed and touching /etc/netplan/ 99-empty. yaml
It does not fail prior to the upgrade.