diff --git a/src/python/WMComponent/RetryManager/RetryManagerPoller.py b/src/python/WMComponent/RetryManager/RetryManagerPoller.py index 716f822f877..93a4d089960 100644 --- a/src/python/WMComponent/RetryManager/RetryManagerPoller.py +++ b/src/python/WMComponent/RetryManager/RetryManagerPoller.py @@ -50,6 +50,8 @@ Any parameter can be skipped and the component will use internal defaults. """ +from future.utils import viewvalues + import datetime import logging import threading @@ -125,7 +127,7 @@ def __init__(self, config): self.typePluginsAssoc = getattr(self.config.RetryManager, 'plugins', {}) self.typePluginsAssoc.setdefault('default', 'DefaultRetryAlgo') - for pluginName in self.typePluginsAssoc.values(): + for pluginName in viewvalues(self.typePluginsAssoc): try: plugin = self.pluginFactory.loadObject(classname=pluginName, args=config) @@ -189,7 +191,7 @@ def processRetries(self, jobs, cooloffType): transitions = Transitions() oldstate = '%scooloff' % cooloffType - if oldstate not in transitions.keys(): + if oldstate not in transitions: msg = 'Unknown job type %s' % cooloffType logging.error(msg) return