Fix pep8 warnings

Change-Id: Icd648746ea0296bbb5f89042b1c0ae8b80d3a515
This commit is contained in:
Radomir Dopieralski 2014-12-02 14:59:36 +01:00
parent b3c49ab78a
commit 1dd4aa3154
8 changed files with 24 additions and 21 deletions

View File

@ -43,12 +43,12 @@ class EditPlan(forms.EditPlan):
fields['%s-flavor' % role.id] = field
return fields
def handle(self, request, data):
result = super(EditPlan, self).handle(request, data)
parameters = dict(
(field.role.flavor_parameter_name, data[name])
for (name, field) in self.fields.items() if name.endswith('-flavor')
for (name, field) in self.fields.items()
if name.endswith('-flavor')
)
try:
self.plan = self.plan.patch(request, self.plan.uuid, parameters)

View File

@ -13,11 +13,9 @@
# under the License.
from django.utils.translation import ugettext_lazy as _
import horizon
import tuskar_ui.infrastructure.dashboard as tuskar_dashboard
from tuskar_ui.infrastructure.overview.panel import Overview as TuskarOverview
from tuskar_ui.infrastructure.overview import panel
class Overview(horizon.Panel):
@ -25,5 +23,5 @@ class Overview(horizon.Panel):
slug = "overview"
tuskar_dashboard.Infrastructure.unregister(TuskarOverview)
tuskar_dashboard.Infrastructure.unregister(panel.Overview)
tuskar_dashboard.Infrastructure.register(Overview)

View File

@ -13,8 +13,8 @@
# under the License.
from django.conf import urls
from tuskar_ui.infrastructure.overview import urls as tuskar_urls
import tuskar_boxes.overview.views as views

View File

@ -13,9 +13,9 @@
# under the License.
import django.utils.text
from tuskar_ui import api
from tuskar_ui.infrastructure.overview import views
from tuskar_boxes.overview import forms
@ -62,7 +62,7 @@ class IndexView(views.IndexView):
flavors = api.flavor.Flavor.list(self.request)
flavors.sort(key=lambda np: (np.vcpus, np.ram, np.disk))
for role in context['roles']:
flavor = role['role'].flavor(context['plan'])
flavor = role['role'].flavor(context['plan'])
role['flavor_name'] = flavor.name if flavor else ''
if not context['stack']:
context['flavors'] = []
@ -94,8 +94,8 @@ class IndexView(views.IndexView):
nodes.append({
'uuid': node.uuid,
'role_name': role.name if role else '',
'role_slug': django.utils.text.slugify(role.name)
if role else '',
'role_slug': (
django.utils.text.slugify(role.name) if role else ''),
'state': node.state,
'state_slug': django.utils.text.slugify(
unicode(node.state)),

View File

@ -14,9 +14,8 @@
from django.utils.translation import ugettext_lazy as _
import horizon
from tuskar_ui.infrastructure import dashboard
from tuskar_ui.infrastructure.nodes.panel import Nodes as TuskarNodes
from tuskar_ui.infrastructure.nodes import panel
class Nodes(horizon.Panel):
@ -24,5 +23,5 @@ class Nodes(horizon.Panel):
slug = "nodes"
dashboard.Infrastructure.unregister(TuskarNodes)
dashboard.Infrastructure.unregister(panel.Nodes)
dashboard.Infrastructure.register(Nodes)

View File

@ -11,16 +11,21 @@
# 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 requests
import urllib
import collections
from collections import namedtuple
from horizon import tabs
import requests
from tuskar_ui.infrastructure.nodes import tabs as nodes_tabs
from .tables import ErrataTable
from tuskar_sat_ui.nodes import tables
ErrataItem = namedtuple('ErrataItem', ['title', 'type', 'id', 'issued'])
ErrataItem = collections.namedtuple('ErrataItem', [
'title',
'type',
'id',
'issued',
])
class DetailOverviewTab(nodes_tabs.DetailOverviewTab):
@ -67,7 +72,7 @@ class DetailOverviewTab(nodes_tabs.DetailOverviewTab):
else:
data = [ErrataItem(x['title'], x['type'], x['id'], x['issued'])
for x in errata]
result['errata'] = ErrataTable(request, data=data)
result['errata'] = tables.ErrataTable(request, data=data)
return result

View File

@ -13,8 +13,8 @@
# under the License.
from django.conf import urls
from tuskar_ui.infrastructure.nodes import views
from tuskar_sat_ui.nodes import views as sat_views

View File

@ -13,6 +13,7 @@
# under the License.
from tuskar_ui.infrastructure.nodes import views
from tuskar_sat_ui.nodes import tabs