Include the plan name on node assignment

Only the 'overcloud' default plan node counts would get updated
otherwise.

Change-Id: Ib497e0c6258befdd8734019fa0d8354ff9d6d56c
Depends-On: Ifaeb9df96dbd7ca6a5553ecdc22c6ab8c56b7365
Closes-Bug: #1642342
This commit is contained in:
Julie Pichon 2016-11-17 12:21:32 +00:00
parent 75a4c46df3
commit 93d2e6beb5
2 changed files with 9 additions and 5 deletions

View File

@ -273,12 +273,12 @@ export default {
};
},
startNodesAssignment(tagNodeIds, untagNodeIds, role) {
startNodesAssignment(tagNodeIds, untagNodeIds, role, planName) {
const flatNodes = tagNodeIds.concat(untagNodeIds);
return (dispatch, getState) => {
dispatch(this.startOperation(flatNodes));
MistralApiService.runWorkflow(MistralConstants.TAG_NODES,
{ tag_node_uuids: tagNodeIds, untag_node_uuids: untagNodeIds, role: role })
{ tag_node_uuids: tagNodeIds, untag_node_uuids: untagNodeIds, role: role, plan: planName })
.then((response) => {
if(response.state === 'ERROR') {
dispatch(NotificationActions.notify({ title: 'Error', message: response.state_info }));

View File

@ -10,6 +10,7 @@ import { getAvailableNodes,
getUnassignedAvailableNodes,
getNodesOperationInProgress,
getAssignedNodes } from '../../selectors/nodes';
import { getCurrentPlan } from '../../selectors/plans';
import FormErrorList from '../ui/forms/FormErrorList';
import Modal from '../ui/Modal';
import NodesActions from '../../actions/NodesActions';
@ -56,7 +57,8 @@ class NodesAssignment extends React.Component {
});
const role = this.props.params.roleIdentifier;
this.props.assignNodes(tagNodeIds, untagNodeIds, role);
const planName = this.props.currentPlan.name;
this.props.assignNodes(tagNodeIds, untagNodeIds, role, planName);
resetForm();
}
@ -107,6 +109,7 @@ class NodesAssignment extends React.Component {
NodesAssignment.propTypes = {
assignNodes: React.PropTypes.func.isRequired,
availableNodes: ImmutablePropTypes.map,
currentPlan: ImmutablePropTypes.record,
fetchNodes: React.PropTypes.func.isRequired,
formErrors: ImmutablePropTypes.list.isRequired,
formFieldErrors: ImmutablePropTypes.map.isRequired,
@ -125,6 +128,7 @@ NodesAssignment.defaultProps = {
function mapStateToProps(state) {
return {
availableNodes: getAvailableNodes(state),
currentPlan: getCurrentPlan(state),
isFetchingNodes: state.nodes.get('isFetching'),
nodesInProgress: state.nodes.get('nodesInProgress'),
nodesOperationInProgress: getNodesOperationInProgress(state),
@ -136,8 +140,8 @@ function mapStateToProps(state) {
function mapDispatchToProps(dispatch) {
return {
fetchNodes: () => dispatch(NodesActions.fetchNodes()),
assignNodes: (tagNodeIds, untagNodeIds, role) =>
dispatch(NodesActions.startNodesAssignment(tagNodeIds, untagNodeIds, role)
assignNodes: (tagNodeIds, untagNodeIds, role, planName) =>
dispatch(NodesActions.startNodesAssignment(tagNodeIds, untagNodeIds, role, planName)
)
};
}