Skip to content
This repository has been archived by the owner on Feb 7, 2019. It is now read-only.

Conversation

VinceMacBuche
Copy link
Member

@@ -152,7 +152,8 @@ class InventoryDigestServiceV1(
def getKey (receivedInventory : InventoryReport) : Box[(PublicKey, KeyStatus)] = {
for {
nodeInventory <- repo.get(receivedInventory.node.main.id) match {
case Full(storedInventory) =>
// Don't get the node inventory if there is no public key in it
case Full(storedInventory) if ! storedInventory.node.publicKeys.isEmpty =>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand why you need to check here for emptiness, as it is done just after - and in the following check the error message would be more specialised.
In fact, I think that you want to check something more powerfull than just emptiness, it's the key validity: "if there is an existing stored inventory with at least (exactly ?) one readable key in it, then use it; Else, consider the stored inventory like not intersting, and use the new one key.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering if we should not also try to read the key status in the stored inventory, so that one does not have to just corrupt the strored key to have the new one accepter, he also need to change the status back to not verified.

@VinceMacBuche
Copy link
Member Author

PR updated

@VinceMacBuche VinceMacBuche force-pushed the bug_6600/cannot_modify_root_server_inventory_after_new_install branch from 99a6c3e to a06da4a Compare May 18, 2015 14:51
case UndefinedKey =>
storedInventory.node.publicKeys.headOption match {
case None =>
// There is no key and status in undefined, use received key
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i_s_ undefined

@VinceMacBuche
Copy link
Member Author

PR updated

@VinceMacBuche VinceMacBuche force-pushed the bug_6600/cannot_modify_root_server_inventory_after_new_install branch from a06da4a to b32713b Compare May 18, 2015 15:08
fanf added a commit that referenced this pull request May 18, 2015
…_server_inventory_after_new_install

Fixes #6600: Cannot modify root server inventory after new install
@fanf fanf merged commit 8e632c3 into Normation:branches/rudder/3.1 May 18, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants