9e28b6b5fd
Creates a dialog for scaling the deployment. We are still missing the API calls to initiate the actual deployment update. I also still need to make the "Change" column work with JS. Change-Id: I9d843916ff92017467a9accc44ae7a029179ded9 Implements: blueprint tripleo-deployment-scaling-dialog
40 lines
1.4 KiB
Python
40 lines
1.4 KiB
Python
# -*- coding: utf8 -*-
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
|
# not use this file except in compliance with the License. You may obtain
|
|
# a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
# License for the specific language governing permissions and limitations
|
|
# under the License.
|
|
|
|
import django.forms
|
|
from django.utils.translation import ugettext_lazy as _
|
|
import horizon.workflows
|
|
|
|
from tuskar_ui.infrastructure.overcloud.workflows import undeployed_overview
|
|
|
|
|
|
class Action(undeployed_overview.Action):
|
|
overcloud_id = django.forms.IntegerField(widget=django.forms.HiddenInput)
|
|
|
|
class Meta:
|
|
slug = 'scale_node_counts'
|
|
name = _("Node Counts")
|
|
|
|
|
|
class Step(horizon.workflows.Step):
|
|
action_class = Action
|
|
contributes = ('role_counts', 'overcloud_id')
|
|
template_name = 'infrastructure/overcloud/scale_node_counts.html'
|
|
|
|
def prepare_action_context(self, request, context):
|
|
for (role_id, profile_id), count in context['role_counts'].items():
|
|
name = 'count__%s__%s' % (role_id, profile_id)
|
|
context[name] = count
|
|
return context
|