From 8b171aaddfd9d7131501c06e4041f34c7bdbad9d Mon Sep 17 00:00:00 2001 From: Ross Brattain Date: Thu, 26 Jan 2017 14:04:52 -0800 Subject: vnf_generic: replace list comprehension with generator expression no need to build a list, just use next Change-Id: I8a899ac538849b765f12bebda4fb8c89c84f333e Signed-off-by: Ross Brattain --- yardstick/benchmark/scenarios/networking/vnf_generic.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yardstick/benchmark/scenarios/networking/vnf_generic.py b/yardstick/benchmark/scenarios/networking/vnf_generic.py index d7ba418c3..29b297db0 100644 --- a/yardstick/benchmark/scenarios/networking/vnf_generic.py +++ b/yardstick/benchmark/scenarios/networking/vnf_generic.py @@ -237,10 +237,10 @@ class NetworkServiceTestCase(base.Scenario): import_modules_from_package( "yardstick.network_services.vnf_generic.vnf") expected_name = vnf_model['id'] - impl = [c for c in itersubclasses(GenericVNF) - if c.__name__ == expected_name] + impl = (c for c in itersubclasses(GenericVNF) + if c.__name__ == expected_name) try: - return next(iter(impl)) + return next(impl) except StopIteration: raise IncorrectConfig("No implementation for %s", expected_name) -- cgit 1.2.3-korg