From 1f7db44a17b02a591d5ff9f64ee0717c697b8a5d Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Fri, 28 May 2021 19:11:15 +0200 Subject: dummy: T2241: minor code cleanup No need to call .keys() on a dict when searching for a key. Also drop the unused "import os" call. --- src/conf_mode/interfaces-dummy.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/conf_mode/interfaces-dummy.py') diff --git a/src/conf_mode/interfaces-dummy.py b/src/conf_mode/interfaces-dummy.py index 44fc9cb9e..55c783f38 100755 --- a/src/conf_mode/interfaces-dummy.py +++ b/src/conf_mode/interfaces-dummy.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # -# Copyright (C) 2019-2020 VyOS maintainers and contributors +# Copyright (C) 2019-2021 VyOS maintainers and contributors # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 or later as @@ -14,8 +14,6 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -import os - from sys import exit from vyos.config import Config @@ -42,7 +40,7 @@ def get_config(config=None): return dummy def verify(dummy): - if 'deleted' in dummy.keys(): + if 'deleted' in dummy: verify_bridge_delete(dummy) return None @@ -58,7 +56,7 @@ def apply(dummy): d = DummyIf(dummy['ifname']) # Remove dummy interface - if 'deleted' in dummy.keys(): + if 'deleted' in dummy: d.remove() else: d.update(dummy) -- cgit v1.2.3