Merge "Use NFV nomenclature for VNF and VNFD method names"

This commit is contained in:
Jenkins
2016-02-11 20:05:27 +00:00
committed by Gerrit Code Review
7 changed files with 19 additions and 19 deletions

View File

@@ -26,7 +26,7 @@ class MyFilterAction(tables.FilterAction):
name = "myfilter"
class DeleteVNFLink(policy.PolicyTargetMixin, tables.DeleteAction):
class DeleteVNFD(policy.PolicyTargetMixin, tables.DeleteAction):
@staticmethod
def action_present(count):
return ungettext_lazy(
@@ -47,7 +47,7 @@ class DeleteVNFLink(policy.PolicyTargetMixin, tables.DeleteAction):
api.tacker.delete_vnfd(request, obj_id)
class OnBoardVNFLink(tables.LinkAction):
class OnBoardVNF(tables.LinkAction):
name = "onboardvnf"
verbose_name = _("Onboard VNF")
classes = ("ajax-modal",)
@@ -69,4 +69,4 @@ class VNFCatalogTable(tables.DataTable):
class Meta(object):
name = "vnfcatalog"
verbose_name = _("VNFCatalog")
table_actions = (OnBoardVNFLink, DeleteVNFLink, MyFilterAction,)
table_actions = (OnBoardVNF, DeleteVNFD, MyFilterAction,)

View File

@@ -26,7 +26,7 @@ from tacker_horizon.openstack_dashboard import api
LOG = logging.getLogger(__name__)
class AddService(forms.SelfHandlingForm):
class DeployVNF(forms.SelfHandlingForm):
vnf_name = forms.CharField(max_length=80, label=_("VNF Name"))
vnfd_id = forms.ChoiceField(label=_("VNF Catalog Name"))
source_type = forms.ChoiceField(
@@ -79,7 +79,7 @@ class AddService(forms.SelfHandlingForm):
required=False)
def __init__(self, request, *args, **kwargs):
super(AddService, self).__init__(request, *args, **kwargs)
super(DeployVNF, self).__init__(request, *args, **kwargs)
try:
vnfd_list = api.tacker.vnfd_list(request)
@@ -93,7 +93,7 @@ class AddService(forms.SelfHandlingForm):
] + available_choices
def clean(self):
data = super(AddService, self).clean()
data = super(DeployVNF, self).clean()
param_file = data.get('param_file', None)
param_raw = data.get('direct_input', None)

View File

@@ -138,7 +138,7 @@ class VNFUpdateRow(tables.Row):
raise
class DeleteServicesLink(policy.PolicyTargetMixin, tables.DeleteAction):
class DeleteVNF(policy.PolicyTargetMixin, tables.DeleteAction):
@staticmethod
def action_present(count):
return ungettext_lazy(
@@ -159,12 +159,12 @@ class DeleteServicesLink(policy.PolicyTargetMixin, tables.DeleteAction):
api.tacker.delete_vnf(request, obj_id)
class AddServicesLink(tables.LinkAction):
name = "addservice"
class DeployVNF(tables.LinkAction):
name = "deployvnf"
verbose_name = _("Deploy VNF")
classes = ("ajax-modal",)
icon = "plus"
url = "horizon:nfv:vnfmanager:addservice"
url = "horizon:nfv:vnfmanager:deployvnf"
class VNFManagerTable(tables.DataTable):
@@ -253,4 +253,4 @@ class VNFManagerTable(tables.DataTable):
verbose_name = _("VNFManager")
status_columns = ["status", ]
row_class = VNFUpdateRow
table_actions = (AddServicesLink, DeleteServicesLink, MyFilterAction,)
table_actions = (DeployVNF, DeleteVNF, MyFilterAction,)

View File

@@ -7,5 +7,5 @@
{% endblock page_header %}
{% block main %}
{% include 'nfv/vnfmanager/_add_service.html' %}
{% include 'nfv/vnfmanager/_deploy_vnf.html' %}
{% endblock %}

View File

@@ -22,5 +22,5 @@ from tacker_horizon.openstack_dashboard.dashboards.nfv.vnfmanager import views
urlpatterns = patterns(
'tacker_horizon.openstack_dashboard.dashboards.nfv.vnfmanager.views',
url(r'^$', views.IndexView.as_view(), name='index'),
url(r'^addservice$', views.AddServiceView.as_view(), name='addservice'),
url(r'^deployvnf$', views.DeployVNFView.as_view(), name='deployvnf'),
)

View File

@@ -37,14 +37,14 @@ class IndexView(tabs.TabbedTableView):
return context
class AddServiceView(forms.ModalFormView):
form_class = project_forms.AddService
template_name = 'nfv/vnfmanager/add_service.html'
class DeployVNFView(forms.ModalFormView):
form_class = project_forms.DeployVNF
template_name = 'nfv/vnfmanager/deploy_vnf.html'
success_url = reverse_lazy("horizon:nfv:vnfmanager:index")
modal_id = "add_service_modal"
modal_id = "deploy_vnf_modal"
modal_header = _("Deploy VNF")
submit_label = _("Deploy VNF")
submit_url = "horizon:nfv:vnfmanager:addservice"
submit_url = "horizon:nfv:vnfmanager:deployvnf"
# @memoized.memoized_method
# def get_object(self):
@@ -60,7 +60,7 @@ class AddServiceView(forms.ModalFormView):
return {}
def get_context_data(self, **kwargs):
context = super(AddServiceView, self).get_context_data(**kwargs)
context = super(DeployVNFView, self).get_context_data(**kwargs)
# instance_id = self.kwargs['instance_id']
# context['instance_id'] = instance_id
# context['instance'] = self.get_object()