diff options
author | dermotbradley <dermot_bradley@yahoo.com> | 2020-11-09 17:24:55 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-09 12:24:55 -0500 |
commit | 57349eb7df1c422d9e9558e54b201c85778997ae (patch) | |
tree | c6371d6ebc7b4f31a9898d2e4abaa64cb3cacd4b /cloudinit/net/network_state.py | |
parent | 0dc2d0304a7fa33af18475b99e808fbcdcad44f2 (diff) | |
download | vyos-cloud-init-57349eb7df1c422d9e9558e54b201c85778997ae.tar.gz vyos-cloud-init-57349eb7df1c422d9e9558e54b201c85778997ae.zip |
Make wakeonlan Network Config v2 setting actually work (#626)
Add code so that specifying "wakeonlan: true" actually results in relevant
configuration entry appearing in /etc/network/interfaces, Netplan, and
sysconfig for RHEL and OpenSuse.
Add testcases for the above.
Diffstat (limited to 'cloudinit/net/network_state.py')
-rw-r--r-- | cloudinit/net/network_state.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/cloudinit/net/network_state.py b/cloudinit/net/network_state.py index d9e7fd58..e8bf9e39 100644 --- a/cloudinit/net/network_state.py +++ b/cloudinit/net/network_state.py @@ -369,6 +369,9 @@ class NetworkStateInterpreter(metaclass=CommandHandlerMeta): accept_ra = command.get('accept-ra', None) if accept_ra is not None: accept_ra = util.is_true(accept_ra) + wakeonlan = command.get('wakeonlan', None) + if wakeonlan is not None: + wakeonlan = util.is_true(wakeonlan) iface.update({ 'name': command.get('name'), 'type': command.get('type'), @@ -379,7 +382,8 @@ class NetworkStateInterpreter(metaclass=CommandHandlerMeta): 'address': None, 'gateway': None, 'subnets': subnets, - 'accept-ra': accept_ra + 'accept-ra': accept_ra, + 'wakeonlan': wakeonlan, }) self._network_state['interfaces'].update({command.get('name'): iface}) self.dump_network_state() |