-
Notifications
You must be signed in to change notification settings - Fork 10
Fixes #6600: Cannot modify root server inventory after new install #65
Fixes #6600: Cannot modify root server inventory after new install #65
Conversation
@@ -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 => |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
PR updated |
99a6c3e
to
a06da4a
Compare
case UndefinedKey => | ||
storedInventory.node.publicKeys.headOption match { | ||
case None => | ||
// There is no key and status in undefined, use received key |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i_s_ undefined
PR updated |
a06da4a
to
b32713b
Compare
…_server_inventory_after_new_install Fixes #6600: Cannot modify root server inventory after new install
http://www.rudder-project.org/redmine/issues/6600