diff options
Diffstat (limited to 'python')
| -rw-r--r-- | python/vyos/configdict.py | 19 | ||||
| -rw-r--r--[-rwxr-xr-x] | python/vyos/ifconfig/interface.py | 0 | 
2 files changed, 10 insertions, 9 deletions
| diff --git a/python/vyos/configdict.py b/python/vyos/configdict.py index 04ddc10e9..78225f8d4 100644 --- a/python/vyos/configdict.py +++ b/python/vyos/configdict.py @@ -358,13 +358,14 @@ def get_pppoe_interfaces(conf, vrf=None):      """ Common helper functions to retrieve all interfaces from current CLI      sessions that have DHCP configured. """      pppoe_interfaces = {} +    conf.set_level([])      for ifname in conf.list_nodes(['interfaces', 'pppoe']):          # always reset config level, as get_interface_dict() will alter it          conf.set_level([])          # we already have a dict representation of the config from get_config_dict(),          # but with the extended information from get_interface_dict() we also          # get the DHCP client default-route-distance default option if not specified. -        ifconfig = get_interface_dict(conf, ['interfaces', 'pppoe'], ifname) +        _, ifconfig = get_interface_dict(conf, ['interfaces', 'pppoe'], ifname)          options = {}          if 'default_route_distance' in ifconfig: @@ -455,8 +456,8 @@ def get_interface_dict(config, base, ifname=''):      if bond: dict.update({'is_bond_member' : bond})      # Check if any DHCP options changed which require a client restat -    dhcp = node_changed(config, ['dhcp-options'], recursive=True) -    if dhcp: dict.update({'dhcp_options_changed' : ''}) +    dhcp = is_node_changed(config, base + [ifname, 'dhcp-options']) +    if dhcp: dict.update({'dhcp_options_changed' : {}})      # Some interfaces come with a source_interface which must also not be part      # of any other bond or bridge interface as it is exclusivly assigned as the @@ -515,8 +516,8 @@ def get_interface_dict(config, base, ifname=''):          if bridge: dict['vif'][vif].update({'is_bridge_member' : bridge})          # Check if any DHCP options changed which require a client restat -        dhcp = node_changed(config, ['vif', vif, 'dhcp-options'], recursive=True) -        if dhcp: dict['vif'][vif].update({'dhcp_options_changed' : ''}) +        dhcp = is_node_changed(config, base + [ifname, 'vif', vif, 'dhcp-options']) +        if dhcp: dict['vif'][vif].update({'dhcp_options_changed' : {}})      for vif_s, vif_s_config in dict.get('vif_s', {}).items():          # Add subinterface name to dictionary @@ -554,8 +555,8 @@ def get_interface_dict(config, base, ifname=''):          if bridge: dict['vif_s'][vif_s].update({'is_bridge_member' : bridge})          # Check if any DHCP options changed which require a client restat -        dhcp = node_changed(config, ['vif-s', vif_s, 'dhcp-options'], recursive=True) -        if dhcp: dict['vif_s'][vif_s].update({'dhcp_options_changed' : ''}) +        dhcp = is_node_changed(config, base + [ifname, 'vif-s', vif_s, 'dhcp-options']) +        if dhcp: dict['vif_s'][vif_s].update({'dhcp_options_changed' : {}})          for vif_c, vif_c_config in vif_s_config.get('vif_c', {}).items():              # Add subinterface name to dictionary @@ -594,8 +595,8 @@ def get_interface_dict(config, base, ifname=''):                  {'is_bridge_member' : bridge})              # Check if any DHCP options changed which require a client restat -            dhcp = node_changed(config, ['vif-s', vif_s, 'vif-c', vif_c, 'dhcp-options'], recursive=True) -            if dhcp: dict['vif_s'][vif_s]['vif_c'][vif_c].update({'dhcp_options_changed' : ''}) +            dhcp = is_node_changed(config, base + [ifname, 'vif-s', vif_s, 'vif-c', vif_c, 'dhcp-options']) +            if dhcp: dict['vif_s'][vif_s]['vif_c'][vif_c].update({'dhcp_options_changed' : {}})      # Check vif, vif-s/vif-c VLAN interfaces for removal      dict = get_removed_vlans(config, base + [ifname], dict) diff --git a/python/vyos/ifconfig/interface.py b/python/vyos/ifconfig/interface.py index 22441d1d2..22441d1d2 100755..100644 --- a/python/vyos/ifconfig/interface.py +++ b/python/vyos/ifconfig/interface.py | 
