issue #477: get rid of perl JSON module requirement.

issue510
David Wilson 6 years ago
parent 7d1b0e0807
commit abb0319bbb

@ -9,7 +9,7 @@
- assert:
that:
- out.results[0].input[0].foo
- out.results[0].input.foo
- out.results[0].message == 'I am a perl script! Here is my input.'
- when: ansible_version.full > '2.4'

@ -9,7 +9,7 @@
- assert:
that:
- out.results[0].input[0].foo
- out.results[0].input.foo
- out.results[0].message == 'I am a want JSON perl script! Here is my input.'
- when: ansible_version.full > '2.4'

@ -1,15 +1,10 @@
#!/usr/bin/perl
binmode STDOUT, ":utf8";
use utf8;
use JSON;
my $json_args = <<'END_MESSAGE';
<<INCLUDE_ANSIBLE_MODULE_JSON_ARGS>>
END_MESSAGE
print encode_json({
message => "I am a perl script! Here is my input.",
input => [decode_json($json_args)]
});
print '{';
print ' "message": "I am a perl script! Here is my input.",' . "\n";
print ' "input": ' . $json_args;
print '}' . "\n";

@ -1,12 +1,7 @@
#!/usr/bin/perl
binmode STDOUT, ":utf8";
use utf8;
my $WANT_JSON = 1;
use JSON;
my $json;
{
local $/; #Enable 'slurp' mode
@ -15,7 +10,7 @@ my $json;
close $fh;
}
print encode_json({
message => "I am a want JSON perl script! Here is my input.",
input => [decode_json($json_args)]
});
print "{\n";
print ' "message": "I am a want JSON perl script! Here is my input.",' . "\n";
print ' "input": ' . $json_args . "\n";
print "}\n";

Loading…
Cancel
Save