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

View File

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

View File

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