Exception thrown when set-name equals an altname

Bug #1994822 reported by Jorge Merlino
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Netplan
In Progress
Undecided
Jorge Merlino

Bug Description

When a netplan configuration file contains a set-name for an interface and that name has been already set as an altname by systemd, netplan throws an exception and the interface ends up with no ip address.

Example:

Config file:
ens3:
    dhcp4: true
    match:
        macaddress: xx:xx:xx:xx:xx:xx
    set-name: enp0s3

Interface:
2: ens3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 52:54:00:1e:76:cc brd ff:ff:ff:ff:ff:ff
    altname enp0s3

Exception:
Traceback (most recent call last):
  File "/usr/sbin/netplan", line 23, in <module>
    netplan.main()
  File "/usr/share/netplan/netplan/cli/core.py", line 50, in main
    self.run_command()
  File "/usr/share/netplan/netplan/cli/utils.py", line 247, in run_command
    self.func()
  File "/usr/share/netplan/netplan/cli/commands/apply.py", line 61, in run
    self.run_command()
  File "/usr/share/netplan/netplan/cli/utils.py", line 247, in run_command
    self.func()
  File "/usr/share/netplan/netplan/cli/commands/apply.py", line 245, in command_apply
    subprocess.check_call(['ip', 'link', 'set',
  File "/usr/lib/python3.8/subprocess.py", line 364, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['ip', 'link', 'set', 'dev', 'ens3', 'name', 'enp0s3']' returned non-zero exit stat

Tags: sts
Changed in netplan:
assignee: nobody → Jorge Merlino (jorge-merlino)
Revision history for this message
Jorge Merlino (jorge-merlino) wrote :
Lukas Märdian (slyon)
Changed in netplan:
status: New → In Progress
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.