From fd8f88769a7bba59faaee423f0de2f12c603c8e2 Mon Sep 17 00:00:00 2001 From: Joe LeVeque Date: Sat, 31 Oct 2020 00:00:37 +0000 Subject: [PATCH] Iterate dict directly rather than list(dict.keys()) --- src/sonic-host-services/scripts/hostcfgd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sonic-host-services/scripts/hostcfgd b/src/sonic-host-services/scripts/hostcfgd index 3145b819d356..51579430398f 100755 --- a/src/sonic-host-services/scripts/hostcfgd +++ b/src/sonic-host-services/scripts/hostcfgd @@ -312,7 +312,7 @@ class HostConfigDaemon: def update_all_feature_states(self): feature_table = self.config_db.get_table('FEATURE') - for feature_name in list(feature_table.keys()): + for feature_name in feature_table: if not feature_name: syslog.syslog(syslog.LOG_WARNING, "Feature is None") continue @@ -358,7 +358,7 @@ class HostConfigDaemon: def feature_state_handler(self, key, data): feature_name = key feature_table = self.config_db.get_table('FEATURE') - if feature_name not in list(feature_table.keys()): + if feature_name not in feature_table: syslog.syslog(syslog.LOG_WARNING, "Feature '{}' not in FEATURE table".format(feature_name)) return