From 8d2503bd2a33c330953952e66da5083a15364252 Mon Sep 17 00:00:00 2001 From: Dan Voiculeasa Date: Thu, 15 Jul 2021 13:59:04 +0300 Subject: [PATCH] Fix flake8 error in Python2 environment An anti-pattern is used. In Python2 list comprehension iterator variable value will override broader scoped variable value. Here the value was not used further, so no runtime error existed. Fixed the iterator variable name. Story: 2008454 Task: 42842 Signed-off-by: Dan Voiculeasa Change-Id: I534f4b1194f50446481f653b08fcd4eaff872708 --- sysinv/sysinv/sysinv/sysinv/conductor/manager.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sysinv/sysinv/sysinv/sysinv/conductor/manager.py b/sysinv/sysinv/sysinv/sysinv/conductor/manager.py index f55f0a1c99..3d68fcc110 100644 --- a/sysinv/sysinv/sysinv/sysinv/conductor/manager.py +++ b/sysinv/sysinv/sysinv/sysinv/conductor/manager.py @@ -12373,10 +12373,11 @@ class ConductorManager(service.PeriodicService): elif not filter_active: ordered_apps.append(app) - LOG.info("Apps reapply order: {}".format([app.name for app in ordered_apps])) + LOG.info("Apps reapply order: {}".format( + [app_.name for app_ in ordered_apps])) if name_only: - ordered_apps = [app.name for app in ordered_apps] + ordered_apps = [app_.name for app_ in ordered_apps] except Exception as e: LOG.error("Error while ordering apps for reapply {}".format(str(e))) ordered_apps = []