Commit 273e84b3 authored by Xavier Guimard's avatar Xavier Guimard

Clean some Dumper usage (#1416)

parent fdf2327b
#!/usr/bin/perl
use Data::Dumper;
use Plack::Builder;
# Basic test app
......
......@@ -2,7 +2,6 @@ package Lemonldap::NG::Common::Cli;
use strict;
use Mouse;
use Data::Dumper;
use Lemonldap::NG::Common::Conf;
our $VERSION = '2.0.0';
......
......@@ -9,7 +9,6 @@ use strict;
use Mouse;
use Crypt::OpenSSL::RSA;
use Crypt::OpenSSL::X509;
use Data::Dumper;
use HTML::Template;
use MIME::Base64;
use Safe;
......
......@@ -131,7 +131,7 @@ sub oldUnserialize {
if ( $k =~ $hashParameters and $v ||= {} and not ref($v) ) {
$conf->{$k} = {};
# Value should be a Data::Dumper, else this is an old format
# Value should be a Data::Dumper, else this is an old-old format
if ( defined($v) and $v !~ /^\$/ ) {
$Lemonldap::NG::Common::Conf::msg .=
......
......@@ -125,6 +125,7 @@ sub jsonResponse {
or die "PSGI lib has refused my get, aborting";
unless ( $res->[0] == 200 ) {
require Data::Dumper;
$Data::Dumper::Useperl = 1;
print STDERR "Result dump :\n" . Data::Dumper::Dumper($res);
die "Manager lib does not return a 200 code, aborting";
}
......@@ -139,6 +140,7 @@ sub jsonPostResponse {
or die "PSGI lib has refused my post, aborting";
unless ( $res->[0] == 200 ) {
require Data::Dumper;
$Data::Dumper::Useperl = 1;
print STDERR "Result dump :\n" . Data::Dumper::Dumper($res);
die "Manager lib does not return a 200 code, aborting";
}
......@@ -153,6 +155,7 @@ sub jsonPutResponse {
or die "PSGI lib has refused my put, aborting";
unless ( $res->[0] == 200 ) {
require Data::Dumper;
$Data::Dumper::Useperl = 1;
print STDERR "Result dump :\n" . Data::Dumper::Dumper($res);
die "Manager lib does not return a 200 code, aborting";
}
......
......@@ -117,8 +117,6 @@ sub handlerAbort {
sub handler {
my ( $self, $req ) = @_;
#print STDERR Dumper($self->routes);use Data::Dumper;
# Reinitialize configuration message
$Lemonldap::NG::Common::Conf::msg = '';
......
......@@ -6,7 +6,6 @@ package Lemonldap::NG::Handler::Lib::Status;
use strict;
use POSIX qw(setuid setgid);
use JSON qw(to_json);
use Data::Dumper;
our $VERSION = '2.0.0';
......
use Test::More;
use JSON;
use Data::Dumper;
use MIME::Base64;
require 't/test-psgi-lib.pm';
......
use Test::More;
use JSON;
use Data::Dumper;
use MIME::Base64;
require 't/test-psgi-lib.pm';
......
use Test::More;
use JSON;
use Data::Dumper;
use MIME::Base64;
require 't/test-psgi-lib.pm';
......
use Test::More;
use JSON;
use Data::Dumper;
use MIME::Base64;
require 't/test-psgi-lib.pm';
......
use Test::More;
use JSON;
use Data::Dumper;
use MIME::Base64;
use LWP::UserAgent;
......
use Test::More;
use JSON;
use Data::Dumper;
use MIME::Base64;
BEGIN {
......
# Base library for tests
use strict;
use Data::Dumper;
use 5.10.0;
use POSIX 'strftime';
use_ok('Lemonldap::NG::Common::PSGI::Cli::Lib');
our $client;
our $count = 1;
$Data::Dumper::Deparse = 1;
no warnings 'redefine';
......
......@@ -6,6 +6,7 @@ use Data::Dumper;
use Lemonldap::NG::Common::Conf::ReConstants;
our $VERSION = '2.0.0';
$Data::Dumper::Useperl = 1;
extends('Lemonldap::NG::Manager::Cli::Lib');
......
......@@ -79,6 +79,7 @@ sub hdebug {
foreach my $d (@_) {
if ( ref $d ) {
require Data::Dumper;
$Data::Dumper::Useperl = 1;
print STDERR Data::Dumper::Dumper($d);
}
else { print STDERR "$d\n" }
......
......@@ -32,7 +32,8 @@ $refConf->{cfgLog} = '';
# Sort keys
$Data::Dumper::Sortkeys = 1;
my $tmp = Dumper($refConf);
$Data::Dumper::Useperl = 1;
my $tmp = Dumper($refConf);
my $refFile = File::Temp->new( UNLINK => 1 );
my $editFile = File::Temp->new( UNLINK => 1 );
......@@ -68,12 +69,13 @@ if (`diff $refFile $editFile`) {
{
refConf => $refConf,
newConf => $VAR1,
req => 1,
req => 1,
}
);
unless($parser->testNewConf) {
unless ( $parser->testNewConf ) {
print STDERR "Configuration seems to have some errors:\n ";
print STDERR Dumper({errors => $parser->errors,warnings => $parser->warnings});
print STDERR Dumper(
{ errors => $parser->errors, warnings => $parser->warnings } );
print STDERR "Are you sure you want to write it ? (yes/no) ";
my $resp = <STDIN>;
die "Aborted" unless $resp =~ /^yes$/i;
......
......@@ -3,7 +3,6 @@
use Test::More;
use strict;
use Data::Dumper;
my $formDir = 'site/htdocs/static/forms';
......
......@@ -43,7 +43,6 @@ foreach my $query (@bad) {
or print STDERR "# Receive a $res->[0] code";
my $href;
#print STDERR Dumper($res->[2]);use Data::Dumper;
ok( $href = from_json( $res->[2]->[0] ), 'Response is JSON' );
ok( $href->{error}, "Receive an explanation message ($href->{error})" );
count(3);
......
......@@ -29,6 +29,4 @@ ok( $res->[0] == 200, "Result code is 200" );
ok( $key = from_json( $res->[2]->[0] ), 'Response is JSON' );
count(3);
#print STDERR Dumper($key);use Data::Dumper;
done_testing( count() );
......@@ -3,7 +3,6 @@
use Test::More;
use strict;
use JSON;
use Data::Dumper;
require 't/test-lib.pm';
my @struct =
......
......@@ -4,7 +4,6 @@
use Test::More;
use strict;
use JSON;
use Data::Dumper;
require 't/test-lib.pm';
my $struct = 't/jsonfiles/12-modified.json';
......
......@@ -3,7 +3,6 @@
use Test::More;
use strict;
use JSON;
use Data::Dumper;
require 't/test-lib.pm';
my $struct = 't/jsonfiles/14-bad.json';
......
......@@ -3,7 +3,6 @@
use Test::More;
use strict;
use JSON;
use Data::Dumper;
require 't/test-lib.pm';
my $struct = 't/jsonfiles/15-combination.json';
......
......@@ -3,7 +3,6 @@
use strict;
use Test::More;
use Data::Dumper;
# CONSTANTS
......
# Base library for tests
use strict;
use Data::Dumper;
use 5.10.0;
use_ok('Lemonldap::NG::Manager::Cli::Lib');
......
......@@ -679,7 +679,8 @@ sub cookie {
sub _dump {
my ( $self, $variable ) = @_;
require Data::Dumper;
$Data::Dumper::Indent = 0;
$Data::Dumper::Indent = 0;
$Data::Dumper::Useperl = 1;
$self->logger->debug( "Dump: " . Data::Dumper::Dumper($variable) );
return;
}
......
......@@ -3,7 +3,6 @@ package main;
use strict;
use Data::Dumper;
$Data::Dumper::Sortkeys = 1;
use LWP::UserAgent;
use URI::Escape;
use 5.10.0;
......@@ -15,7 +14,9 @@ BEGIN {
}
our $count = 1;
$Data::Dumper::Deparse = 1;
$Data::Dumper::Deparse = 1;
$Data::Dumper::Sortkeys = 1;
$Data::Dumper::Useperl = 1;
my $ini;
sub count {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment