Reset changed? state after saving with DirtyAssociations
Getting an error while registering a host using activation key with system purpose attributes. Even though there is an error, the host gets registered with the activation key successfully.
Steps to reproduce the bug:
1. Create an activation key with system purpose attributes.
2. Register a host using this activation key with the following command.
subscription-manager register --org "Default_Organization" --activationkey "keyname"
3. Getting the following error -
HTTP error (500 - Internal Server Error): Required lock is already taken by other running tasks.
Please inspect their state, fix their errors and resume them.
Required lock: update
Conflicts with tasks:
Updated by Jonathon Turel about 4 years ago
- Subject changed from Can't register a system using activation key with system purpose. to Reset changed? state after saving with DirtyAssociations
This bug was originally written in the context of Activation Keys in Katello but we found that the underlying issue was the fact that <relation>_changed? continued to return true even after saving the model object. This caused a lot of extra saves for us in Katello. By making DirtyAssociations behave more like ActiveModel::Dirty we can avoid the problem and have the expected behavior