From 0202c64de1f6df4974ea5d645a200910d0a65f98 Mon Sep 17 00:00:00 2001 From: ZTE-SuZhengwei Date: Tue, 30 Aug 2016 16:17:55 +0800 Subject: [PATCH] remove needless brackets If the cfg don't have the key, it will raise "PipelineException" ahead, so here is no need to set default value. Change-Id: Id2865ac55ff6d7042084471ab40def4f5ac64c3b --- ceilometer/pipeline.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ceilometer/pipeline.py b/ceilometer/pipeline.py index c471dc8863..e6954efd69 100644 --- a/ceilometer/pipeline.py +++ b/ceilometer/pipeline.py @@ -703,7 +703,7 @@ class PipelineManager(object): unique_names = set() sources = [] - for s in cfg.get('sources', []): + for s in cfg.get('sources'): name = s.get('name') if name in unique_names: raise PipelineException("Duplicated source names: %s" % @@ -714,7 +714,7 @@ class PipelineManager(object): unique_names.clear() sinks = {} - for s in cfg.get('sinks', []): + for s in cfg.get('sinks'): name = s.get('name') if name in unique_names: raise PipelineException("Duplicated sink names: %s" % @@ -764,7 +764,7 @@ class PollingManager(object): LOG.info(_LI('detected decoupled pipeline config format')) unique_names = set() - for s in cfg.get('sources', []): + for s in cfg.get('sources'): name = s.get('name') if name in unique_names: raise PipelineException("Duplicated source names: %s" %