Sort keys in lmConfigEditor (#946)

environments/ppa-mbqj77/deployments/1
Clément Oudot 9 years ago
parent 242794fe99
commit 19875fcffa
  1. 8
      lemonldap-ng-manager/scripts/lmConfigEditor

@ -28,7 +28,11 @@ delete $tmp->{cfgAuthor};
delete $tmp->{cfgAuthorIP};
delete $tmp->{cfgDate};
$tmp->{cfgLog} = '';
$tmp = Dumper($tmp);
# Sort keys
$Data::Dumper::Sortkeys = 1;
$tmp = Dumper($tmp);
my $refFile = File::Temp->new( UNLINK => 1 );
my $editFile = File::Temp->new( UNLINK => 1 );
print $refFile $tmp;
@ -53,7 +57,7 @@ if (`diff $refFile $editFile`) {
# Update author and date
$VAR1->{cfgAuthor} = $ENV{SUDO_USER} || $ENV{LOGNAME} || "lmConfigEditor";
$VAR1->{cfgAuthorIP} = $ENV{SSH_CONNECTION} || "localhost";
$VAR1->{cfgDate} = time();
$VAR1->{cfgDate} = time();
$VAR1->{cfgLog} ||= 'Edited by lmConfigEditor';
# Store new configuration

Loading…
Cancel
Save