From 0bf6af6d22f9d9a6ed4a4c37dd51bc0782ca51c5 Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Wed, 15 Nov 2017 07:30:35 +0100 Subject: [PATCH] Skip empty parameter. Fixes #599. (#600) --- cdist/core/cdist_type.py | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/cdist/core/cdist_type.py b/cdist/core/cdist_type.py index beb459b3..40194f94 100644 --- a/cdist/core/cdist_type.py +++ b/cdist/core/cdist_type.py @@ -155,7 +155,9 @@ class CdistType(object): "parameter", "required")) as fd: for line in fd: - parameters.append(line.strip()) + line = line.strip() + if line: + parameters.append(line) except EnvironmentError: # error ignored pass @@ -173,7 +175,9 @@ class CdistType(object): "parameter", "required_multiple")) as fd: for line in fd: - parameters.append(line.strip()) + line = line.strip() + if line: + parameters.append(line) except EnvironmentError: # error ignored pass @@ -191,7 +195,9 @@ class CdistType(object): "parameter", "optional")) as fd: for line in fd: - parameters.append(line.strip()) + line = line.strip() + if line: + parameters.append(line) except EnvironmentError: # error ignored pass @@ -209,7 +215,9 @@ class CdistType(object): "parameter", "optional_multiple")) as fd: for line in fd: - parameters.append(line.strip()) + line = line.strip() + if line: + parameters.append(line) except EnvironmentError: # error ignored pass @@ -227,7 +235,9 @@ class CdistType(object): "parameter", "boolean")) as fd: for line in fd: - parameters.append(line.strip()) + line = line.strip() + if line: + parameters.append(line) except EnvironmentError: # error ignored pass