From 565adae6c7e334c5231e9bfc82c7624ecc7f5cf0 Mon Sep 17 00:00:00 2001 From: doantungbk Date: Wed, 24 Oct 2018 01:39:50 -0700 Subject: [PATCH] Update python jobs Change-Id: I8d431538610ffa8492a3067e93f0165937d6e3ff Signed-off-by: doantungbk --- .zuul.yaml | 5 +++++ apmec_horizon/openstack_dashboard/api/apmec.py | 5 ++--- .../dashboards/mec/meacatalog/panel.py | 3 ++- .../dashboards/mec/meacatalog/tables.py | 3 ++- .../dashboards/mec/meacatalog/tabs.py | 11 +++++------ .../dashboards/mec/meamanager/forms.py | 2 +- .../dashboards/mec/meamanager/panel.py | 2 +- .../dashboards/mec/meamanager/tables.py | 4 ++-- .../dashboards/mec/meamanager/tabs.py | 10 +++++----- .../dashboards/mec/mescatalog/forms.py | 4 ++-- .../dashboards/mec/mescatalog/panel.py | 2 +- .../dashboards/mec/mescatalog/tables.py | 2 +- .../dashboards/mec/mescatalog/tabs.py | 6 +++--- .../dashboards/mec/mesmanager/forms.py | 14 +++++++------- .../dashboards/mec/mesmanager/panel.py | 3 ++- .../dashboards/mec/mesmanager/tables.py | 10 +++++----- .../dashboards/mec/mesmanager/tabs.py | 10 +++++----- .../dashboards/mec/vim/panel.py | 2 +- .../dashboards/mec/vim/tables.py | 2 +- .../openstack_dashboard/dashboards/mec/vim/tabs.py | 2 +- 20 files changed, 54 insertions(+), 48 deletions(-) diff --git a/.zuul.yaml b/.zuul.yaml index 67a39c4..1842387 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -1,4 +1,9 @@ - project: + templates: + - check-requirements + - openstack-python-jobs + - openstack-python35-jobs + - openstack-python36-jobs check: jobs: - openstack-tox-lower-constraints diff --git a/apmec_horizon/openstack_dashboard/api/apmec.py b/apmec_horizon/openstack_dashboard/api/apmec.py index 6b8ee1f..77afa7a 100644 --- a/apmec_horizon/openstack_dashboard/api/apmec.py +++ b/apmec_horizon/openstack_dashboard/api/apmec.py @@ -14,12 +14,11 @@ from __future__ import absolute_import -from django.conf import settings -from oslo_log import log as logging from apmecclient.v1_0 import client as apmec_client - +from django.conf import settings from horizon.utils.memoized import memoized # noqa from openstack_dashboard.api import base +from oslo_log import log as logging LOG = logging.getLogger(__name__) diff --git a/apmec_horizon/openstack_dashboard/dashboards/mec/meacatalog/panel.py b/apmec_horizon/openstack_dashboard/dashboards/mec/meacatalog/panel.py index 26000f7..c4db1da 100644 --- a/apmec_horizon/openstack_dashboard/dashboards/mec/meacatalog/panel.py +++ b/apmec_horizon/openstack_dashboard/dashboards/mec/meacatalog/panel.py @@ -13,10 +13,11 @@ # under the License. +from apmec_horizon.openstack_dashboard.dashboards.mec import dashboard + from django.utils.translation import ugettext_lazy as _ import horizon -from apmec_horizon.openstack_dashboard.dashboards.mec import dashboard class Meacatalog(horizon.Panel): diff --git a/apmec_horizon/openstack_dashboard/dashboards/mec/meacatalog/tables.py b/apmec_horizon/openstack_dashboard/dashboards/mec/meacatalog/tables.py index 5474658..92764bd 100644 --- a/apmec_horizon/openstack_dashboard/dashboards/mec/meacatalog/tables.py +++ b/apmec_horizon/openstack_dashboard/dashboards/mec/meacatalog/tables.py @@ -13,13 +13,14 @@ # under the License. +from apmec_horizon.openstack_dashboard import api + from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ungettext_lazy from horizon import tables from openstack_dashboard import policy -from apmec_horizon.openstack_dashboard import api class MyFilterAction(tables.FilterAction): diff --git a/apmec_horizon/openstack_dashboard/dashboards/mec/meacatalog/tabs.py b/apmec_horizon/openstack_dashboard/dashboards/mec/meacatalog/tabs.py index ad57068..f31a20d 100644 --- a/apmec_horizon/openstack_dashboard/dashboards/mec/meacatalog/tabs.py +++ b/apmec_horizon/openstack_dashboard/dashboards/mec/meacatalog/tabs.py @@ -12,16 +12,15 @@ # License for the specific language governing permissions and limitations # under the License. +from apmec_horizon.openstack_dashboard import api +from apmec_horizon.openstack_dashboard.dashboards.mec.meacatalog import tables +from apmec_horizon.openstack_dashboard.dashboards.mec import utils from django.utils.translation import ugettext_lazy as _ from horizon import exceptions from horizon import tabs -from apmec_horizon.openstack_dashboard import api -from apmec_horizon.openstack_dashboard.dashboards.mec import utils -from apmec_horizon.openstack_dashboard.dashboards.mec.meacatalog import tables - class MEACatalogItem(object): def __init__(self, name, description, services, mead_id): @@ -49,7 +48,7 @@ class MEACatalogTab(tabs.TableTab): self._has_more = False catalogs = [] meads = api.apmec.mead_list(self.request, - template_source="onboarded") + template_source="onboarded") for mead in meads: s_types = [s_type for s_type in mead['service_types'] if s_type != 'mead'] @@ -100,7 +99,7 @@ class MEADEventsTab(tabs.TableTab): self._has_more = True utils.EventItemList.clear_list() events = api.apmec.events_list(self.request, - self.tab_group.kwargs['mead_id']) + self.tab_group.kwargs['mead_id']) for event in events: evt_obj = utils.EventItem( event['id'], event['resource_state'], diff --git a/apmec_horizon/openstack_dashboard/dashboards/mec/meamanager/forms.py b/apmec_horizon/openstack_dashboard/dashboards/mec/meamanager/forms.py index 7cb8d2c..6ef064c 100644 --- a/apmec_horizon/openstack_dashboard/dashboards/mec/meamanager/forms.py +++ b/apmec_horizon/openstack_dashboard/dashboards/mec/meamanager/forms.py @@ -112,7 +112,7 @@ class DeployMEA(forms.SelfHandlingForm): try: mead_list = api.apmec.mead_list(request, - template_source='onboarded') + template_source='onboarded') available_choices_mead = [(mea['id'], mea['name']) for mea in mead_list] except Exception as e: diff --git a/apmec_horizon/openstack_dashboard/dashboards/mec/meamanager/panel.py b/apmec_horizon/openstack_dashboard/dashboards/mec/meamanager/panel.py index c5af5eb..20a7912 100644 --- a/apmec_horizon/openstack_dashboard/dashboards/mec/meamanager/panel.py +++ b/apmec_horizon/openstack_dashboard/dashboards/mec/meamanager/panel.py @@ -12,11 +12,11 @@ # License for the specific language governing permissions and limitations # under the License. +from apmec_horizon.openstack_dashboard.dashboards.mec import dashboard from django.utils.translation import ugettext_lazy as _ import horizon -from apmec_horizon.openstack_dashboard.dashboards.mec import dashboard class Meamanager(horizon.Panel): diff --git a/apmec_horizon/openstack_dashboard/dashboards/mec/meamanager/tables.py b/apmec_horizon/openstack_dashboard/dashboards/mec/meamanager/tables.py index ee4ee86..101206c 100644 --- a/apmec_horizon/openstack_dashboard/dashboards/mec/meamanager/tables.py +++ b/apmec_horizon/openstack_dashboard/dashboards/mec/meamanager/tables.py @@ -12,6 +12,8 @@ # License for the specific language governing permissions and limitations # under the License. +from apmec_horizon.openstack_dashboard import api +from apmecclient.common.exceptions import NotFound from django.http import Http404 from django.utils.translation import pgettext_lazy @@ -22,8 +24,6 @@ from horizon import messages from horizon import tables from openstack_dashboard import policy -from apmec_horizon.openstack_dashboard import api -from apmecclient.common.exceptions import NotFound class MEAManagerItem(object): diff --git a/apmec_horizon/openstack_dashboard/dashboards/mec/meamanager/tabs.py b/apmec_horizon/openstack_dashboard/dashboards/mec/meamanager/tabs.py index e1ad587..cda37b0 100644 --- a/apmec_horizon/openstack_dashboard/dashboards/mec/meamanager/tabs.py +++ b/apmec_horizon/openstack_dashboard/dashboards/mec/meamanager/tabs.py @@ -12,14 +12,14 @@ # License for the specific language governing permissions and limitations # under the License. +from apmec_horizon.openstack_dashboard import api +from apmec_horizon.openstack_dashboard.dashboards.mec.meamanager import tables +from apmec_horizon.openstack_dashboard.dashboards.mec import utils + from django.utils.translation import ugettext_lazy as _ from horizon import exceptions from horizon import tabs -from apmec_horizon.openstack_dashboard import api -from apmec_horizon.openstack_dashboard.dashboards.mec import utils -from apmec_horizon.openstack_dashboard.dashboards.mec.meamanager import tables - class MEAManagerTab(tabs.TableTab): name = _("MEAManager Tab") @@ -102,7 +102,7 @@ class MEAEventsTab(tabs.TableTab): self._has_more = True utils.EventItemList.clear_list() events = api.apmec.events_list(self.request, - self.tab_group.kwargs['mea_id']) + self.tab_group.kwargs['mea_id']) for event in events: evt_obj = utils.EventItem( event['id'], event['resource_state'], diff --git a/apmec_horizon/openstack_dashboard/dashboards/mec/mescatalog/forms.py b/apmec_horizon/openstack_dashboard/dashboards/mec/mescatalog/forms.py index 720441c..44085b6 100644 --- a/apmec_horizon/openstack_dashboard/dashboards/mec/mescatalog/forms.py +++ b/apmec_horizon/openstack_dashboard/dashboards/mec/mescatalog/forms.py @@ -91,8 +91,8 @@ class OnBoardMES(forms.SelfHandlingForm): mesd_name = data['name'] mesd_description = data['description'] tosca_arg = {'mesd': {'name': mesd_name, - 'description': mesd_description, - 'attributes': {'mesd': toscal}}} + 'description': mesd_description, + 'attributes': {'mesd': toscal}}} mesd_instance = api.apmec.create_mesd(request, tosca_arg) messages.success(request, _('MES Catalog entry %s has been created.') % diff --git a/apmec_horizon/openstack_dashboard/dashboards/mec/mescatalog/panel.py b/apmec_horizon/openstack_dashboard/dashboards/mec/mescatalog/panel.py index 1beba34..24c2264 100644 --- a/apmec_horizon/openstack_dashboard/dashboards/mec/mescatalog/panel.py +++ b/apmec_horizon/openstack_dashboard/dashboards/mec/mescatalog/panel.py @@ -10,11 +10,11 @@ # License for the specific language governing permissions and limitations # under the License. +from apmec_horizon.openstack_dashboard.dashboards.mec import dashboard from django.utils.translation import ugettext_lazy as _ import horizon -from apmec_horizon.openstack_dashboard.dashboards.mec import dashboard class Mescatalog(horizon.Panel): diff --git a/apmec_horizon/openstack_dashboard/dashboards/mec/mescatalog/tables.py b/apmec_horizon/openstack_dashboard/dashboards/mec/mescatalog/tables.py index 7190f4a..06769bd 100644 --- a/apmec_horizon/openstack_dashboard/dashboards/mec/mescatalog/tables.py +++ b/apmec_horizon/openstack_dashboard/dashboards/mec/mescatalog/tables.py @@ -10,6 +10,7 @@ # License for the specific language governing permissions and limitations # under the License. +from apmec_horizon.openstack_dashboard import api from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ungettext_lazy @@ -17,7 +18,6 @@ from django.utils.translation import ungettext_lazy from horizon import tables from openstack_dashboard import policy -from apmec_horizon.openstack_dashboard import api class MyFilterAction(tables.FilterAction): diff --git a/apmec_horizon/openstack_dashboard/dashboards/mec/mescatalog/tabs.py b/apmec_horizon/openstack_dashboard/dashboards/mec/mescatalog/tabs.py index 717c5b6..439c4ec 100644 --- a/apmec_horizon/openstack_dashboard/dashboards/mec/mescatalog/tabs.py +++ b/apmec_horizon/openstack_dashboard/dashboards/mec/mescatalog/tabs.py @@ -45,8 +45,8 @@ class MESCatalogTab(tabs.TableTab): mesds = api.apmec.mesd_list(self.request) for mesd in mesds: item = MESCatalogItem(mesd['name'], - mesd['description'], - mesd['id']) + mesd['description'], + mesd['id']) instances.append(item) return instances except Exception: @@ -87,7 +87,7 @@ class MESDEventsTab(tabs.TableTab): self._has_more = True utils.EventItemList.clear_list() events = api.apmec.events_list(self.request, - self.tab_group.kwargs['mesd_id']) + self.tab_group.kwargs['mesd_id']) for event in events: evt_obj = utils.EventItem( event['id'], event['resource_state'], diff --git a/apmec_horizon/openstack_dashboard/dashboards/mec/mesmanager/forms.py b/apmec_horizon/openstack_dashboard/dashboards/mec/mesmanager/forms.py index 4a87a23..3cc2964 100644 --- a/apmec_horizon/openstack_dashboard/dashboards/mec/mesmanager/forms.py +++ b/apmec_horizon/openstack_dashboard/dashboards/mec/mesmanager/forms.py @@ -10,6 +10,8 @@ # License for the specific language governing permissions and limitations # under the License. +from apmec_horizon.openstack_dashboard import api + from django.forms import ValidationError from django.utils.translation import ugettext_lazy as _ from oslo_log import log as logging @@ -18,8 +20,6 @@ from horizon import exceptions from horizon import forms from horizon import messages -from apmec_horizon.openstack_dashboard import api - LOG = logging.getLogger(__name__) @@ -86,7 +86,7 @@ class DeployMES(forms.SelfHandlingForm): try: mesd_list = api.apmec.mesd_list(request) available_choices_mesd = [(mes['id'], mes['name']) for mes in - mesd_list] + mesd_list] except Exception as e: available_choices_mesd = [] msg = _('Failed to retrieve available MES Catalog names: %s') % e @@ -102,8 +102,8 @@ class DeployMES(forms.SelfHandlingForm): msg = _('Failed to retrieve available VIM names: %s') % e LOG.error(msg) - self.fields['mesd_id'].choices = [('', _('Select a MES Catalog Name')) - ]+available_choices_mesd + self.fields['mesd_id'].choices =\ + [('', _('Select a MES Catalog Name'))] + available_choices_mesd self.fields['vim_id'].choices = [('', _('Select a VIM Name')) ]+available_choices_vims @@ -157,8 +157,8 @@ class DeployMES(forms.SelfHandlingForm): param_val = data['param_values'] config_val = data['config_values'] mes_arg = {'mes': {'mesd_id': mesd_id, 'name': mes_name, - 'description': description, - 'vim_id': vim_id}} + 'description': description, + 'vim_id': vim_id}} mes_attr = mes_arg['mes'].setdefault('attributes', {}) if param_val: mes_attr['param_values'] = param_val diff --git a/apmec_horizon/openstack_dashboard/dashboards/mec/mesmanager/panel.py b/apmec_horizon/openstack_dashboard/dashboards/mec/mesmanager/panel.py index c443854..7332bc0 100644 --- a/apmec_horizon/openstack_dashboard/dashboards/mec/mesmanager/panel.py +++ b/apmec_horizon/openstack_dashboard/dashboards/mec/mesmanager/panel.py @@ -11,10 +11,11 @@ # under the License. +from apmec_horizon.openstack_dashboard.dashboards.mec import dashboard + from django.utils.translation import ugettext_lazy as _ import horizon -from apmec_horizon.openstack_dashboard.dashboards.mec import dashboard class Mesmanager(horizon.Panel): diff --git a/apmec_horizon/openstack_dashboard/dashboards/mec/mesmanager/tables.py b/apmec_horizon/openstack_dashboard/dashboards/mec/mesmanager/tables.py index ea55b15..735b661 100644 --- a/apmec_horizon/openstack_dashboard/dashboards/mec/mesmanager/tables.py +++ b/apmec_horizon/openstack_dashboard/dashboards/mec/mesmanager/tables.py @@ -10,6 +10,8 @@ # License for the specific language governing permissions and limitations # under the License. +from apmec_horizon.openstack_dashboard import api +from apmecclient.common.exceptions import NotFound from django.http import Http404 from django.utils.translation import ugettext_lazy as _ @@ -19,8 +21,6 @@ from horizon import messages from horizon import tables from openstack_dashboard import policy -from apmec_horizon.openstack_dashboard import api -from apmecclient.common.exceptions import NotFound class MESManagerItem(object): @@ -90,9 +90,9 @@ class MESUpdateRow(tables.Row): if not item: # Add an item entry item = MESManagerItem(mes['name'], mes_desc_str, - str(vim), - mes['status'], mes['id'], - mes['error_reason']) + str(vim), + mes['status'], mes['id'], + mes['error_reason']) else: item.description = mes_desc_str item.status = mes['status'] diff --git a/apmec_horizon/openstack_dashboard/dashboards/mec/mesmanager/tabs.py b/apmec_horizon/openstack_dashboard/dashboards/mec/mesmanager/tabs.py index bc81eca..b1f5bc4 100644 --- a/apmec_horizon/openstack_dashboard/dashboards/mec/mesmanager/tabs.py +++ b/apmec_horizon/openstack_dashboard/dashboards/mec/mesmanager/tabs.py @@ -10,14 +10,14 @@ # License for the specific language governing permissions and limitations # under the License. -from django.utils.translation import ugettext_lazy as _ -from horizon import exceptions -from horizon import tabs - from apmec_horizon.openstack_dashboard import api from apmec_horizon.openstack_dashboard.dashboards.mec.mesmanager import tables from apmec_horizon.openstack_dashboard.dashboards.mec import utils +from django.utils.translation import ugettext_lazy as _ +from horizon import exceptions +from horizon import tabs + class MESManagerTab(tabs.TableTab): name = _("MESManager Tab") @@ -79,7 +79,7 @@ class MESEventsTab(tabs.TableTab): self._has_more = True utils.EventItemList.clear_list() events = api.apmec.events_list(self.request, - self.tab_group.kwargs['mes_id']) + self.tab_group.kwargs['mes_id']) for event in events: evt_obj = utils.EventItem( event['id'], event['resource_state'], diff --git a/apmec_horizon/openstack_dashboard/dashboards/mec/vim/panel.py b/apmec_horizon/openstack_dashboard/dashboards/mec/vim/panel.py index 4563235..c216b5f 100644 --- a/apmec_horizon/openstack_dashboard/dashboards/mec/vim/panel.py +++ b/apmec_horizon/openstack_dashboard/dashboards/mec/vim/panel.py @@ -12,11 +12,11 @@ # License for the specific language governing permissions and limitations # under the License. +from apmec_horizon.openstack_dashboard.dashboards.mec import dashboard from django.utils.translation import ugettext_lazy as _ import horizon -from apmec_horizon.openstack_dashboard.dashboards.mec import dashboard class Vimmanager(horizon.Panel): diff --git a/apmec_horizon/openstack_dashboard/dashboards/mec/vim/tables.py b/apmec_horizon/openstack_dashboard/dashboards/mec/vim/tables.py index cc385ce..79740ef 100644 --- a/apmec_horizon/openstack_dashboard/dashboards/mec/vim/tables.py +++ b/apmec_horizon/openstack_dashboard/dashboards/mec/vim/tables.py @@ -12,6 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. +from apmec_horizon.openstack_dashboard import api from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ungettext_lazy @@ -19,7 +20,6 @@ from django.utils.translation import ungettext_lazy from horizon import tables from openstack_dashboard import policy -from apmec_horizon.openstack_dashboard import api class MyFilterAction(tables.FilterAction): diff --git a/apmec_horizon/openstack_dashboard/dashboards/mec/vim/tabs.py b/apmec_horizon/openstack_dashboard/dashboards/mec/vim/tabs.py index 2034805..5d03506 100644 --- a/apmec_horizon/openstack_dashboard/dashboards/mec/vim/tabs.py +++ b/apmec_horizon/openstack_dashboard/dashboards/mec/vim/tabs.py @@ -92,7 +92,7 @@ class VIMEventsTab(tabs.TableTab): self._has_more = True utils.EventItemList.clear_list() events = api.apmec.events_list(self.request, - self.tab_group.kwargs['vim_id']) + self.tab_group.kwargs['vim_id']) for event in events: evt_obj = utils.EventItem( event['id'], event['resource_state'],