Update python jobs

Change-Id: I8d431538610ffa8492a3067e93f0165937d6e3ff
Signed-off-by: doantungbk <doantungbk.203@gmail.com>
This commit is contained in:
doantungbk 2018-10-24 01:39:50 -07:00
parent 1d82401bd2
commit 565adae6c7
20 changed files with 54 additions and 48 deletions

View File

@ -1,4 +1,9 @@
- project:
templates:
- check-requirements
- openstack-python-jobs
- openstack-python35-jobs
- openstack-python36-jobs
check:
jobs:
- openstack-tox-lower-constraints

View File

@ -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__)

View File

@ -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):

View File

@ -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):

View File

@ -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'],

View File

@ -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:

View File

@ -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):

View File

@ -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):

View File

@ -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'],

View File

@ -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.') %

View File

@ -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):

View File

@ -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):

View File

@ -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'],

View File

@ -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

View File

@ -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):

View File

@ -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']

View File

@ -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'],

View File

@ -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):

View File

@ -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):

View File

@ -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'],