Fix check after saveConf (#2742)

This commit is contained in:
Maxime Besson 2022-04-26 19:08:46 +02:00
parent 9314c2f356
commit 826308fbbf
5 changed files with 5 additions and 5 deletions

View File

@ -115,7 +115,7 @@ sub new {
# Serialize $conf and call store().
# @param $conf Lemonldap::NG configuration hashRef
# @param %args Parameters
# @return Number of the saved configuration, 0 in case of error.
# @return Number of the saved configuration, <=0 in case of error.
sub saveConf {
my ( $self, $conf, %args ) = @_;

View File

@ -112,7 +112,7 @@ foreach (@available) {
next if ( $opts{force} );
exit 6;
}
if ( my $r = $new->saveConf( $conf, %newargs ) ) {
if ( $new->saveConf( $conf, %newargs ) > 0 ) {
print "Conf $conf->{cfgNum} stored\n";
next;
}

View File

@ -466,7 +466,7 @@ if ( !$opts{'dry-run'} ) {
print "[OK] Configuration $numConf saved\n";
$exitCode = 0;
}
unless ($numConf) {
unless ( $numConf > 0 ) {
print "[ERROR] Unable to save configuration\n";
$exitCode = 1;
}

View File

@ -50,7 +50,7 @@ $conf->{oidcServicePrivateKeySig} = $keys->{private};
$conf->{oidcServicePublicKeySig} = $keys->{public};
$conf->{oidcServiceKeyIdSig} = $keys->{id};
$lmconf->saveConf($conf) or die $Lemonldap::NG::Common::Conf::msg;
( $lmconf->saveConf($conf) > 0 ) or die $Lemonldap::NG::Common::Conf::msg;
print "Configuration saved\n" if $debug;

View File

@ -1962,7 +1962,7 @@ sub registration {
$self->conf->{oidcServiceDynamicRegistrationExtraClaims};
}
if ( $self->confAcc->saveConf($conf) ) {
if ( $self->confAcc->saveConf($conf) > 0 ) {
# Reload RP list
$self->loadRPs();