[Bug 1942930] Re: Unset a subtree crashes

Lukas Märdian 1942930 at bugs.launchpad.net
Mon Oct 4 12:14:35 UTC 2021


** Also affects: netplan.io (Ubuntu)
   Importance: Undecided
       Status: New

** Also affects: netplan.io (Ubuntu Impish)
   Importance: Undecided
       Status: New

** Also affects: netplan.io (Ubuntu Hirsute)
   Importance: Undecided
       Status: New

** Also affects: netplan.io (Ubuntu Focal)
   Importance: Undecided
       Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to netplan.io in Ubuntu.
Matching subscriptions: foundations-bugs
https://bugs.launchpad.net/bugs/1942930

Title:
  Unset a subtree crashes

Status in netplan:
  In Progress
Status in netplan.io package in Ubuntu:
  New
Status in netplan.io source package in Focal:
  New
Status in netplan.io source package in Hirsute:
  New
Status in netplan.io source package in Impish:
  New

Bug description:
  While working on the snapd netplan integration I ran into the following peculiar issue.
  I want to unset a subtree of configuration, e.g. I have:
  # netplan get
  network:
    version: 2
    ethernets:
      all-en:
        dhcp4: true
        match:
          name: en*
      all-eth:
        dhcp4: true
        match:
          name: eth*

  and want to remove all ethernet configuration. AIUI this can be done
  via setting the subtree to "null" (or did I misunderstood this)? If I
  try that I get:

  # netplan set network.ethernets=null
  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 264, in run_command
      self.func()
    File "/usr/share/netplan/netplan/cli/commands/set.py", line 52, in run
      self.run_command()
    File "/usr/share/netplan/netplan/cli/utils.py", line 264, in run_command
      self.func()
    File "/usr/share/netplan/netplan/cli/commands/set.py", line 95, in command_set
      hints = self.split_tree_by_hint(set_tree)
    File "/usr/share/netplan/netplan/cli/commands/set.py", line 61, in split_tree_by_hint
      for netdef in network.get(devtype, []):
  TypeError: 'NoneType' object is not iterable

  Do you have any hints how I can delete an entire subtree via the
  commandline (well, via dbus but it's a direct mapping so cmdline is
  fine).

  This is Ubuntu Core 20 with netplan 0.102-0ubuntu1~20.04.2 but I can also reproduce this on my 21.04 system with:
  $ sudo netplan get
  network:
    bridges:
      br54:
        dhcp4: true
        dhcp6: true
    renderer: NetworkManager
    version: 2
  $ sudo netplan set network.bridges=null
  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 264, in run_command
      self.func()
    File "/usr/share/netplan/netplan/cli/commands/set.py", line 52, in run
      self.run_command()
    File "/usr/share/netplan/netplan/cli/utils.py", line 264, in run_command
      self.func()
    File "/usr/share/netplan/netplan/cli/commands/set.py", line 95, in command_set
      hints = self.split_tree_by_hint(set_tree)
    File "/usr/share/netplan/netplan/cli/commands/set.py", line 61, in split_tree_by_hint
      for netdef in network.get(devtype, []):
  TypeError: 'NoneType' object is not iterable

To manage notifications about this bug go to:
https://bugs.launchpad.net/netplan/+bug/1942930/+subscriptions




More information about the foundations-bugs mailing list