Commit c98eee6c authored by Côme Chilliet's avatar Côme Chilliet
Browse files

Fixes #4515 --migrate-dns should now active DNS tab on DNS servers

parent 9220ea3f
......@@ -1363,13 +1363,32 @@ sub migrate_dns {
$result->code && die "Migration of DNS zone subentry failed, LDAP error: ".$result->error."\n";
}
$mesg = $ldap->search(
base => $systemdn,
scope => 'base',
filter => '(objectClass=*)'
);
$mesg->code && die $mesg->error;
my $system_entry = $mesg->shift_entry;
$system_entry->get_value('objectClass');
my @classes = $system_entry->get_value('objectClass');
if (grep {$_ eq 'fdDNSHost'} @classes) {
$result = $ldap->modify (
"$systemdn",
add => {
'fdDNSZoneDn' => 'zoneName=fd.org.,ou=dns,dc=opensides,dc=be',
'fdDNSZoneDn' => $zoneDn,
}
);
} else {
$result = $ldap->modify (
"$systemdn",
add => {
'fdDNSZoneDn' => $zoneDn,
'objectClass' => 'fdDNSHost'
}
);
}
$result->code && print "Could not add DNS tab on $systemdn, LDAP error: ".$result->error."\nYou'll need to activate it yourself\n";
}
}
......
Supports Markdown
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