From fff21105589c3bafd34cb0d7ee2cdc04ea4db92a Mon Sep 17 00:00:00 2001 From: ts Date: Wed, 10 Jul 2019 14:47:23 +0100 Subject: [PATCH] post_provision_tests: fix for if the module name is in the path, we still get the correct json file. --- lib/objects/post_provision_test.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/objects/post_provision_test.rb b/lib/objects/post_provision_test.rb index 99e4c9041..a7351f4c0 100644 --- a/lib/objects/post_provision_test.rb +++ b/lib/objects/post_provision_test.rb @@ -111,7 +111,10 @@ class PostProvisionTest def get_json_inputs json_inputs_path = "#{File.expand_path('../', self.module_path)}/secgen_functions/files/json_inputs/*" json_inputs_files = Dir.glob(json_inputs_path) - json_inputs_files.delete_if {|path| !path.include?(self.module_name)} + json_inputs_files.delete_if do |path| + end_path = path.split('/')[-1] + !end_path.include?(self.module_name) + end if json_inputs_files.size > 0 return JSON.parse(Base64.strict_decode64(File.read(json_inputs_files.first))) end