mirror of
https://github.com/Telecominfraproject/OpenNetworkLinux.git
synced 2026-01-09 16:51:30 +00:00
- Mount the ONL-BOOT context before accessing the default boot-config.
This commit is contained in:
@@ -20,9 +20,12 @@ class OnlBootConfig(object):
|
||||
self._original = self.keys.copy()
|
||||
|
||||
def read(self, bc=None):
|
||||
if bc is None:
|
||||
bc = self.BOOT_CONFIG_DEFAULT
|
||||
self._readf(bc)
|
||||
if bc:
|
||||
self._readf(bc)
|
||||
else:
|
||||
from onl.mounts import OnlMountContextReadOnly
|
||||
with OnlMountContextReadOnly("ONL-BOOT", logger=None):
|
||||
self._readf(self.BOOT_CONFIG_DEFAULT)
|
||||
|
||||
def set(self, k, v):
|
||||
self.keys[k] = v
|
||||
@@ -151,7 +154,7 @@ class OnlBootConfigNet(OnlBootConfig):
|
||||
|
||||
elif self.keys['NETAUTO'] not in ['dhcp', 'up']:
|
||||
raise ValueError("The NETAUTO value '%s' is invalid." % self.keys['NETAUTO'])
|
||||
elif self.keys['NETAUTO'] == 'up' && self.NET_REQUIRED:
|
||||
elif self.keys['NETAUTO'] == 'up' and self.NET_REQUIRED:
|
||||
raise ValueError("NETAUTO is 'up' but non-local networking is required.")
|
||||
|
||||
if 'NETDEV' not in self.keys:
|
||||
|
||||
Reference in New Issue
Block a user