Skip to content

Commit

Permalink
Fixes #13843: Inventory keeps its key certified when node is deleted …
Browse files Browse the repository at this point in the history
…even is keystatus is erased
  • Loading branch information
fanf committed Nov 16, 2018
1 parent 53340a3 commit 5819e44
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import com.normation.rudder.domain.eventlog._
import com.normation.utils.ScalaReadWriteLock
import com.normation.rudder.domain.nodes.NodeInfo
import com.normation.eventlog.ModificationId
import com.normation.inventory.domain.UndefinedKey
import com.normation.inventory.ldap.core.InventoryDit
import com.normation.inventory.ldap.core.LDAPConstants
import com.normation.ldap.sdk.RwLDAPConnection
Expand Down Expand Up @@ -243,7 +244,7 @@ class RemoveNodeServiceImpl(
private def removeKeyCertification(nodeId: NodeId): Box[LDIFChangeRecord] = {
for {
con <- ldap
res <- con.modify(deletedDit.NODES.NODE.dn(nodeId.value), new Modification(ModificationType.DELETE, LDAPConstants.A_KEY_STATUS))
res <- con.modify(deletedDit.NODES.NODE.dn(nodeId.value), new Modification(ModificationType.REPLACE, LDAPConstants.A_KEY_STATUS, UndefinedKey.value))
} yield {
res
}
Expand Down

0 comments on commit 5819e44

Please sign in to comment.