Make sure assignment does not leave host with wrong state on exception #87
Conversation
host.type = 'Host::Managed' | ||
host.managed = true | ||
host.build = true | ||
original_type = discovered_host.type |
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.
nitpick: can we use rails dirty cache like discovered_host.type_was
for this?
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 am not sure how this works in combination with #becomes
. The attribute hash is shared between those objects. I was worried that it might now work. Update: i've tested, it does not work. type_was
returns nil
instead of original value :(
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.
ok, nevermind, consider this as 👍
Broken, fixing ... |
Make sure assignment does not leave host with wrong state on exception
@sseago please revert this, it is not working. |
@pitr-ch Yes, sorry. I misread your "fixing" comment as "fixed". -- sorry. We're trying to get the (ready to go) stuff on master for another build and were a bit too enthusiastic here. |
Thanks, I'll fix this tomorrow. It's not critical. |
Revert "Merge pull request #87 from pitr-ch/master"
cc @ares