From 827b0443c8cde0a5a9a5bbfa43f3ef0f32278ab7 Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Tue, 21 Jul 2015 08:47:13 -0400 Subject: [PATCH] now dataloader checkis that you get at least a valid string as a file name --- lib/ansible/parsing/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/ansible/parsing/__init__.py b/lib/ansible/parsing/__init__.py index 0605afdd746..7181136a304 100644 --- a/lib/ansible/parsing/__init__.py +++ b/lib/ansible/parsing/__init__.py @@ -137,6 +137,8 @@ class DataLoader(): Reads the file contents from the given file name, and will decrypt them if they are found to be vault-encrypted. ''' + if not file_name or not isinstance(file_name, basestring): + raise AnsibleParserError("Invalid filename: '%s'" % str(file_name)) if not self.path_exists(file_name) or not self.is_file(file_name): raise AnsibleParserError("the file_name '%s' does not exist, or is not readable" % file_name)