onl-boot-config: Support empty NETAUTO

Since empty NETAUTO= in /mnt/onl/boot/boot-config is valud according to
rules in initramfs /boot/ifup, follow this behavior in onl-boot-config
to get rid of incorrect message:

  root@localhost:/# onl-boot-config --show
  NETDEV=ma1
  BOOTMODE=INSTALLED
  SWI=images::latest
  NETAUTO=
  The NETAUTO value '' is invalid.
  The boot configuration has not been changed.

Signed-off-by: Sergey Popovich <sergey.popovich@ordnance.co>
This commit is contained in:
Sergey Popovich
2018-08-06 08:38:29 +03:00
parent 14c387475b
commit 0106c6a542

View File

@@ -191,7 +191,7 @@ class OnlBootConfigNet(OnlBootConfig):
if not self.is_ip_address(netdns):
raise ValueError("NETDNS=%s is not a valid ip-address" % (netdns))
elif self.keys['NETAUTO'] not in ['dhcp', 'up']:
elif self.keys['NETAUTO'] not in ['dhcp', 'up', '']:
raise ValueError("The NETAUTO value '%s' is invalid." % self.keys['NETAUTO'])
elif self.keys['NETAUTO'] == 'up' and self.NET_REQUIRED:
raise ValueError("NETAUTO is 'up' but non-local networking is required.")