summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoss Brattain <ross.b.brattain@intel.com>2017-01-26 14:04:52 -0800
committerRoss Brattain <ross.b.brattain@intel.com>2017-02-08 06:50:37 +0000
commit8b171aaddfd9d7131501c06e4041f34c7bdbad9d (patch)
treee46535e7d99566a313402ebd2a3e16bf3489a541
parenta4241e6e9b121447a50fdfe0d79b322c2e2aaea9 (diff)
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 <ross.b.brattain@intel.com>
-rw-r--r--yardstick/benchmark/scenarios/networking/vnf_generic.py6
1 files 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)