Fix pep8 errors

Change-Id: I5f7ee36743f9476580dccf8f52aa097329316d67
This commit is contained in:
Kenji Ishii 2016-09-09 11:52:09 +09:00
parent 74342999ed
commit dc15e9d0d8
3 changed files with 12 additions and 9 deletions

View File

@ -13,11 +13,11 @@
from __future__ import absolute_import
import logging
#from zunclient.v1 import client as zun_client
# from zunclient.v1 import client as zun_client
from horizon import exceptions
from horizon.utils.memoized import memoized
from openstack_dashboard.api import base
# from openstack_dashboard.api import base
# for stab, should remove when use CLI API
import copy
@ -30,6 +30,7 @@ CONTAINER_CREATE_ATTRS = ['name']
STUB_DATA = {}
# for stab, should be removed when use CLI API
class StubResponse(object):
@ -47,8 +48,9 @@ class StubResponse(object):
@memoized
def zunclient(request):
zun_url = ""
pass
""""
zun_url = ""
try:
zun_url = base.url_for(request, 'container')
except exceptions.ServiceCatalogException:
@ -80,7 +82,7 @@ def container_create(request, **kwargs):
kv = v.split("=", 1)
labels[kv[0]] = kv[1]
args["labels"] = labels
#created = zunclient(request).containers.create(**args)
# created = zunclient(request).containers.create(**args)
# create dummy response
args["uuid"] = uuid.uuid1().hex
@ -93,7 +95,7 @@ def container_create(request, **kwargs):
def container_delete(request, id):
#deleted = zunclient(request).containers.delete(id)
# deleted = zunclient(request).containers.delete(id)
deleted = STUB_DATA.pop(id)
return deleted
@ -101,13 +103,13 @@ def container_delete(request, id):
def container_list(request, limit=None, marker=None, sort_key=None,
sort_dir=None, detail=True):
#list = zunclient(request).containers.list(limit, marker, sort_key,
# list = zunclient(request).containers.list(limit, marker, sort_key,
# sort_dir, detail)
list = [STUB_DATA[data] for data in STUB_DATA]
return list
def container_show(request, id):
#show = zunclient(request).containers.get(id)
# show = zunclient(request).containers.get(id)
show = STUB_DATA.get(id)
return show

View File

@ -17,6 +17,7 @@ import horizon
# To register REST api, import below here.
from zun_ui.api import rest_api # noqa
class Containers(horizon.Panel):
name = _("Containers")
slug = "container.containers"

View File

@ -20,9 +20,9 @@ HORIZON_CONFIG.pop('dashboards', None)
HORIZON_CONFIG.pop('default_dashboard', None)
# Update the dashboards with zun_ui
import zun_ui.enabled
import openstack_dashboard.enabled
from openstack_dashboard.utils import settings
import zun_ui.enabled
settings.update_dashboards(
[