crowbar: Remove forgotten nodes from proposals#1116
crowbar: Remove forgotten nodes from proposals#1116vuntz wants to merge 1 commit intocrowbar:masterfrom
Conversation
| if state == "delete" | ||
| # Do more work here - one day. | ||
| # Remove node from all applied proposals | ||
| RoleObject.all.select(&:proposal?).each do |role| |
There was a problem hiding this comment.
Lint/ShadowingOuterLocalVariable: Shadowing outer local variable - role.
Forgotten nodes are not removed from existing proposals (applied and non-applied). While the webui removes non-existing nodes when displaying a proposal, if only the API is used, applying a proposal with such non-existing nodes may result in failures. Closes sap-oc#8
cf0e0a0 to
a31a710
Compare
|
@vuntz shall we merge this, or the CI failure is a blocker? |
|
@aspiers could you weigh in please, we need your help :-) |
|
The CI failure is a standard haproxy failure which has been happening for a while. I doubt the CI even exercises this code path. |
aspiers
left a comment
There was a problem hiding this comment.
I haven't thought hard about this, but it feels like there might be one or even two privacy violations here. I'm sure that's typical within Crowbar, but while fixing them is out of scope of this PR, maybe it shouldn't add new ones.
The first one would be directly manipulating RoleObjects which represent proposals, rather than going through a Proposal facade. Secondly, removing nodes from proposals seems like something that should belong to Proposal, not here. I'm inclined to think that DeployerService should simply invoke that API, rather than implement the removal itself.
However there's a good chance I'm way off base here, in which case let me know and I'll remove my -1.
Forgotten nodes are not removed from existing proposals (applied and
non-applied). While the webui removes non-existing nodes when displaying
a proposal, if only the API is used, applying a proposal with such
non-existing nodes may result in failures.
Closes sap-oc#8