From 9186002e2564967d204722eead2efe32908528d9 Mon Sep 17 00:00:00 2001 From: Sai Sindhur Malleni Date: Thu, 21 Jul 2016 17:15:01 -0400 Subject: [PATCH] Handle case where metadata file list is empty This patch short circuits the if statement so that the script doesnt fail when the list of metadata files is empty. Change-Id: Iecf7c0bc9104aa51c3f22f48b696ec261384ca3b Closes-Bug: #1605390 --- lib/Elastic.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Elastic.py b/lib/Elastic.py index 9ad426770..2276bad4c 100644 --- a/lib/Elastic.py +++ b/lib/Elastic.py @@ -62,7 +62,8 @@ class Elastic: """ def combine_metadata(self, result): - if len(self.config['elasticsearch']['metadata_files']) > 0: + if (self.config['elasticsearch']['metadata_files'] is not None and + len(self.config['elasticsearch']['metadata_files']) > 0): meta = self.config['elasticsearch']['metadata_files'] for _meta in meta: try: