Commit 6a5a51de authored by Côme Chilliet's avatar Côme Chilliet

Merge branch '5768-renaming-dns-zones-often-results-in-an-exception-being-thrown' into '1.3-dev'

Resolve "Renaming DNS zones often results in an Exception being thrown"

See merge request fusiondirectory/fd-plugins!139
parents df1a9343 a023819b
...@@ -467,7 +467,12 @@ class dnsHost extends simplePlugin ...@@ -467,7 +467,12 @@ class dnsHost extends simplePlugin
{ {
$messages = array(); $messages = array();
foreach ($zoneDns as $zoneDn) { foreach ($zoneDns as $zoneDn) {
$tabObject = objects::open($zoneDn, 'dnsZone'); try {
$tabObject = objects::open($zoneDn, 'dnsZone');
} catch (NonExistingLdapNodeException $e) {
/* In this case the zone was just deleted/renamed, so nothing to do here, go on */
continue;
}
$nbRecords = $tabObject->getBaseObject()->ipRemoved($ips); $nbRecords = $tabObject->getBaseObject()->ipRemoved($ips);
if ($nbRecords > 0) { if ($nbRecords > 0) {
$messages[] = sprintf( $messages[] = sprintf(
...@@ -484,7 +489,11 @@ class dnsHost extends simplePlugin ...@@ -484,7 +489,11 @@ class dnsHost extends simplePlugin
{ {
$messages = array(); $messages = array();
foreach ($zoneDns as $zoneDn) { foreach ($zoneDns as $zoneDn) {
$tabObject = objects::open($zoneDn, 'dnsZone'); try {
$tabObject = objects::open($zoneDn, 'dnsZone');
} catch (NonExistingLdapNodeException $e) {
continue;
}
$nbRecords = $tabObject->getBaseObject()->cnRemoved($cn); $nbRecords = $tabObject->getBaseObject()->cnRemoved($cn);
if ($nbRecords > 0) { if ($nbRecords > 0) {
$messages[] = sprintf( $messages[] = sprintf(
......
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