summaryrefslogtreecommitdiff
path: root/src/conf_mode/interfaces-loopback.py
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-06-27 14:58:29 +0200
committerGitHub <noreply@github.com>2020-06-27 14:58:29 +0200
commit4aca048919b2237ce065bf22a775d782e780ff5a (patch)
tree8e9de4aeceba264e3d17f2a385a0e442cbab89de /src/conf_mode/interfaces-loopback.py
parent1d97d52120eaa33a3c2edb39e966002dab7f9576 (diff)
parentadfb4c81a41b9eec4b33a27a8d8db7184dbda6da (diff)
downloadvyos-1x-4aca048919b2237ce065bf22a775d782e780ff5a.tar.gz
vyos-1x-4aca048919b2237ce065bf22a775d782e780ff5a.zip
Merge pull request #480 from c-po/t2653
ifconfig: T2653: move macsec interface to get_config_dict()
Diffstat (limited to 'src/conf_mode/interfaces-loopback.py')
-rwxr-xr-xsrc/conf_mode/interfaces-loopback.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/conf_mode/interfaces-loopback.py b/src/conf_mode/interfaces-loopback.py
index 32e683c07..7c3d8663d 100755
--- a/src/conf_mode/interfaces-loopback.py
+++ b/src/conf_mode/interfaces-loopback.py
@@ -36,13 +36,13 @@ def get_config():
base = ['interfaces', 'loopback', ifname]
loopback = conf.get_config_dict(base, key_mangling=('-', '_'))
+ # Check if interface has been removed
+ if loopback == {}:
+ loopback.update({'deleted' : ''})
+
# store interface instance name in dictionary
loopback.update({'ifname': ifname})
- # Check if interface has been removed
- tmp = {'deleted' : not conf.exists(base)}
- loopback.update(tmp)
-
return loopback
def verify(loopback):
@@ -53,7 +53,7 @@ def generate(loopback):
def apply(loopback):
l = LoopbackIf(loopback['ifname'])
- if loopback['deleted']:
+ if 'deleted' in loopback.keys():
l.remove()
else:
l.update(loopback)