[yast-commit] r49546 - in /trunk/ldap-server/src: LdapServer.pm agent/SlapdConfigAgent.cc
Author: rhafer Date: Thu Jul 31 17:14:57 2008 New Revision: 49546 URL: http://svn.opensuse.org/viewcvs/yast?rev=49546&view=rev Log: Handle LDAPExceptions thrown during .ldap.commitChanges Modified: trunk/ldap-server/src/LdapServer.pm trunk/ldap-server/src/agent/SlapdConfigAgent.cc Modified: trunk/ldap-server/src/LdapServer.pm URL: http://svn.opensuse.org/viewcvs/yast/trunk/ldap-server/src/LdapServer.pm?rev=49546&r1=49545&r2=49546&view=diff ============================================================================== --- trunk/ldap-server/src/LdapServer.pm (original) +++ trunk/ldap-server/src/LdapServer.pm Thu Jul 31 17:14:57 2008 @@ -393,7 +393,13 @@ } Progress->Finish(); } else { - SCR->Execute('.ldapserver.commitChanges' ); + if( ! SCR->Execute('.ldapserver.commitChanges' ) ) + { + my $err = SCR->Error(".ldapserver"); + y2error($err->{'summary'}." ".$err->{'description'}); + $self->SetError( $err->{'summary'}, $err->{'description'} ); + return 0; + } } sleep(1); $configured = $ret; Modified: trunk/ldap-server/src/agent/SlapdConfigAgent.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/ldap-server/src/agent/SlapdConfigAgent.cc?rev=49546&r1=49545&r2=49546&view=diff ============================================================================== --- trunk/ldap-server/src/agent/SlapdConfigAgent.cc (original) +++ trunk/ldap-server/src/agent/SlapdConfigAgent.cc Thu Jul 31 17:14:57 2008 @@ -269,25 +269,35 @@ } else if ( path->component_str(0) == "commitChanges" ) { - if ( globals ) - olc.updateEntry( *globals ); + try { + if ( globals ) + olc.updateEntry( *globals ); - OlcSchemaList::const_iterator j; - for ( j = schema.begin(); j != schema.end() ; j++ ) - { - olc.updateEntry(**j); - } - OlcDatabaseList::const_iterator i; - for ( i = databases.begin(); i != databases.end() ; i++ ) - { - olc.updateEntry(**i); - OlcOverlayList overlays = (*i)->getOverlays(); - OlcOverlayList::const_iterator k; - for ( k = overlays.begin(); k != overlays.end(); k++ ) + OlcSchemaList::const_iterator j; + for ( j = schema.begin(); j != schema.end() ; j++ ) { - y2milestone("Update overlay: %s", (*k)->getDn().c_str() ); - olc.updateEntry(**k); + olc.updateEntry(**j); } + OlcDatabaseList::const_iterator i; + for ( i = databases.begin(); i != databases.end() ; i++ ) + { + olc.updateEntry(**i); + OlcOverlayList overlays = (*i)->getOverlays(); + OlcOverlayList::const_iterator k; + for ( k = overlays.begin(); k != overlays.end(); k++ ) + { + y2milestone("Update overlay: %s", (*k)->getDn().c_str() ); + olc.updateEntry(**k); + } + } + } catch ( LDAPException e ) { + std::string errstring = "Error while commiting changes to config database"; + std::string details = e.getResultMsg() + ": " + e.getServerMsg(); + + lastError->add(YCPString("summary"), + YCPString(errstring) ); + lastError->add(YCPString("description"), YCPString( details ) ); + return YCPBoolean(false); } } else if ( path->component_str(0) == "addRootSaslRegexp" ) -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
rhafer@svn.opensuse.org