Skip to content
This repository has been archived by the owner on Nov 22, 2021. It is now read-only.

Make sure assignment does not leave host with wrong state on exception #87

Merged
merged 1 commit into from Apr 22, 2014

Conversation

pitr-ch
Copy link
Member

@pitr-ch pitr-ch commented Apr 16, 2014

cc @ares

host.type = 'Host::Managed'
host.managed = true
host.build = true
original_type = discovered_host.type
Copy link
Member

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?

Copy link
Member Author

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 :(

Copy link
Member

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 👍

@pitr-ch
Copy link
Member Author

pitr-ch commented Apr 22, 2014

Broken, fixing ...

sseago added a commit that referenced this pull request Apr 22, 2014
Make sure assignment does not leave host with wrong state on exception
@sseago sseago merged commit c3a3d9d into theforeman:master Apr 22, 2014
@pitr-ch
Copy link
Member Author

pitr-ch commented Apr 22, 2014

@sseago please revert this, it is not working.

@sseago
Copy link
Contributor

sseago commented Apr 22, 2014

@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.

sseago added a commit to sseago/staypuft that referenced this pull request Apr 22, 2014
This reverts commit c3a3d9d, reversing
changes made to 15decb6.
@sseago
Copy link
Contributor

sseago commented Apr 22, 2014

@pitr-ch OK PR #100 reverts this

@pitr-ch
Copy link
Member Author

pitr-ch commented Apr 22, 2014

Thanks, I'll fix this tomorrow. It's not critical.

knowncitizen added a commit that referenced this pull request Apr 22, 2014
Revert "Merge pull request #87 from pitr-ch/master"
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants