diff options
Diffstat (limited to 'python')
-rw-r--r-- | python/vyos/accel_ppp.py | 3 | ||||
-rw-r--r-- | python/vyos/ifconfig/tunnel.py | 12 |
2 files changed, 15 insertions, 0 deletions
diff --git a/python/vyos/accel_ppp.py b/python/vyos/accel_ppp.py index bfc8ee5a9..0af311e57 100644 --- a/python/vyos/accel_ppp.py +++ b/python/vyos/accel_ppp.py @@ -38,6 +38,9 @@ def get_server_statistics(accel_statistics, pattern, sep=':') -> dict: if key in ['starting', 'active', 'finishing']: stat_dict['sessions'][key] = value.strip() continue + if key == 'cpu': + stat_dict['cpu_load_percentage'] = int(re.sub(r'%', '', value.strip())) + continue stat_dict[key] = value.strip() return stat_dict diff --git a/python/vyos/ifconfig/tunnel.py b/python/vyos/ifconfig/tunnel.py index 5258a2cb1..f776240a1 100644 --- a/python/vyos/ifconfig/tunnel.py +++ b/python/vyos/ifconfig/tunnel.py @@ -162,6 +162,15 @@ class TunnelIf(Interface): """ Get a synthetic MAC address. """ return self.get_mac_synthetic() + def set_multicast(self): + """ Set multicast """ + if self.config.get('multicast', 'disable') == 'enable': + cmd = 'ip link set dev {ifname} multicast on' + else: + cmd = 'ip link set dev {ifname} multicast off' + + self._cmd(cmd.format(**self.config)) + def update(self, config): """ General helper function which works on a dictionary retrived by get_config_dict(). It's main intention is to consolidate the scattered @@ -170,5 +179,8 @@ class TunnelIf(Interface): # Adjust iproute2 tunnel parameters if necessary self._change_options() + # Add multicast + self.set_multicast() + # call base class first super().update(config) |