diff options
author | Christian Poessinger <christian@poessinger.com> | 2020-06-27 14:58:29 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-27 14:58:29 +0200 |
commit | 4aca048919b2237ce065bf22a775d782e780ff5a (patch) | |
tree | 8e9de4aeceba264e3d17f2a385a0e442cbab89de /src/conf_mode/interfaces-dummy.py | |
parent | 1d97d52120eaa33a3c2edb39e966002dab7f9576 (diff) | |
parent | adfb4c81a41b9eec4b33a27a8d8db7184dbda6da (diff) | |
download | vyos-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-dummy.py')
-rwxr-xr-x | src/conf_mode/interfaces-dummy.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/conf_mode/interfaces-dummy.py b/src/conf_mode/interfaces-dummy.py index 676211428..a8093ffa5 100755 --- a/src/conf_mode/interfaces-dummy.py +++ b/src/conf_mode/interfaces-dummy.py @@ -41,6 +41,10 @@ def get_config(): base = ['interfaces', 'dummy', ifname] dummy = conf.get_config_dict(base, key_mangling=('-', '_')) + # Check if interface has been removed + if dummy == {}: + dummy.update({'deleted' : ''}) + # store interface instance name in dictionary dummy.update({'ifname': ifname}) @@ -50,14 +54,10 @@ def get_config(): tmp = {'is_bridge_member' : bridge} dummy.update(tmp) - # Check if interface has been removed - tmp = {'deleted' : not conf.exists(base)} - dummy.update(tmp) - return dummy def verify(dummy): - if dummy['deleted']: + if 'deleted' in dummy.keys(): verify_bridge_delete(dummy) return None @@ -73,7 +73,7 @@ def apply(dummy): d = DummyIf(dummy['ifname']) # Remove dummy interface - if dummy['deleted']: + if 'deleted' in dummy.keys(): d.remove() else: d.update(dummy) |