Merge "Small "H302 check" cleanup"
This commit is contained in:
commit
c1f1361cdb
|
@ -20,7 +20,7 @@ import urlparse
|
|||
from django.core.urlresolvers import reverse # noqa
|
||||
from django.template.defaultfilters import register # noqa
|
||||
|
||||
from openstack_dashboard.api.swift import FOLDER_DELIMITER # noqa
|
||||
from openstack_dashboard.api import swift
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
@ -50,7 +50,7 @@ resource_urls = {
|
|||
'link': 'horizon:project:networks:subnets:detail'},
|
||||
"OS::Swift::Container": {
|
||||
'link': 'horizon:project:containers:index',
|
||||
'format_pattern': '%s' + FOLDER_DELIMITER},
|
||||
'format_pattern': '%s' + swift.FOLDER_DELIMITER},
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,14 +1,15 @@
|
|||
from django.template.defaultfilters import title # noqa
|
||||
from django.template.loader import render_to_string # noqa
|
||||
|
||||
from horizon.utils.filters import replace_underscores # noqa
|
||||
from horizon.utils import filters
|
||||
|
||||
|
||||
def stack_info(stack, stack_image):
|
||||
stack.stack_status_desc = title(replace_underscores(stack.stack_status))
|
||||
stack.stack_status_desc = title(
|
||||
filters.replace_underscores(stack.stack_status))
|
||||
if stack.stack_status_reason:
|
||||
stack.stack_status_reason = title(
|
||||
replace_underscores(stack.stack_status_reason)
|
||||
filters.replace_underscores(stack.stack_status_reason)
|
||||
)
|
||||
context = {}
|
||||
context['stack'] = stack
|
||||
|
@ -19,11 +20,11 @@ def stack_info(stack, stack_image):
|
|||
|
||||
def resource_info(resource):
|
||||
resource.resource_status_desc = title(
|
||||
replace_underscores(resource.resource_status)
|
||||
filters.replace_underscores(resource.resource_status)
|
||||
)
|
||||
if resource.resource_status_reason:
|
||||
resource.resource_status_reason = title(
|
||||
replace_underscores(resource.resource_status_reason)
|
||||
filters.replace_underscores(resource.resource_status_reason)
|
||||
)
|
||||
context = {}
|
||||
context['resource'] = resource
|
||||
|
|
|
@ -21,8 +21,7 @@ from django.utils.translation import ugettext_lazy as _ # noqa
|
|||
|
||||
from horizon import messages
|
||||
from horizon import tables
|
||||
from horizon.utils.filters import parse_isotime # noqa
|
||||
from horizon.utils.filters import replace_underscores # noqa
|
||||
from horizon.utils import filters
|
||||
|
||||
from heatclient import exc
|
||||
|
||||
|
@ -77,12 +76,12 @@ class StacksTable(tables.DataTable):
|
|||
link="horizon:project:stacks:detail",)
|
||||
created = tables.Column("creation_time",
|
||||
verbose_name=_("Created"),
|
||||
filters=(parse_isotime, timesince))
|
||||
filters=(filters.parse_isotime, timesince))
|
||||
updated = tables.Column("updated_time",
|
||||
verbose_name=_("Updated"),
|
||||
filters=(parse_isotime, timesince))
|
||||
filters=(filters.parse_isotime, timesince))
|
||||
status = tables.Column("stack_status",
|
||||
filters=(title, replace_underscores),
|
||||
filters=(title, filters.replace_underscores),
|
||||
verbose_name=_("Status"),
|
||||
status=True,
|
||||
status_choices=STATUS_CHOICES)
|
||||
|
@ -109,9 +108,9 @@ class EventsTable(tables.DataTable):
|
|||
link=mappings.resource_to_url)
|
||||
timestamp = tables.Column('event_time',
|
||||
verbose_name=_("Time Since Event"),
|
||||
filters=(parse_isotime, timesince))
|
||||
filters=(filters.parse_isotime, timesince))
|
||||
status = tables.Column("resource_status",
|
||||
filters=(title, replace_underscores),
|
||||
filters=(title, filters.replace_underscores),
|
||||
verbose_name=_("Status"),)
|
||||
|
||||
statusreason = tables.Column("resource_status_reason",
|
||||
|
@ -155,9 +154,9 @@ class ResourcesTable(tables.DataTable):
|
|||
verbose_name=_("Stack Resource Type"),)
|
||||
updated_time = tables.Column('updated_time',
|
||||
verbose_name=_("Date Updated"),
|
||||
filters=(parse_isotime, timesince))
|
||||
filters=(filters.parse_isotime, timesince))
|
||||
status = tables.Column("resource_status",
|
||||
filters=(title, replace_underscores),
|
||||
filters=(title, filters.replace_underscores),
|
||||
verbose_name=_("Status"),
|
||||
status=True,
|
||||
status_choices=STATUS_CHOICES)
|
||||
|
|
|
@ -49,7 +49,7 @@ from horizon.test import helpers as horizon_helpers
|
|||
|
||||
from openstack_dashboard import api
|
||||
from openstack_dashboard import context_processors
|
||||
from openstack_dashboard.test.test_data.utils import load_test_data # noqa
|
||||
from openstack_dashboard.test.test_data import utils as test_utils
|
||||
|
||||
|
||||
# Makes output of failing mox tests much easier to read.
|
||||
|
@ -115,7 +115,7 @@ class TestCase(horizon_helpers.TestCase):
|
|||
* Several handy additional assertion methods.
|
||||
"""
|
||||
def setUp(self):
|
||||
load_test_data(self)
|
||||
test_utils.load_test_data(self)
|
||||
self.mox = mox.Mox()
|
||||
self.factory = RequestFactoryWithMessages()
|
||||
self.context = {'authorized_tenants': self.tenants.list()}
|
||||
|
@ -344,7 +344,7 @@ class SeleniumTestCase(horizon_helpers.SeleniumTestCase):
|
|||
def setUp(self):
|
||||
super(SeleniumTestCase, self).setUp()
|
||||
|
||||
load_test_data(self)
|
||||
test_utils.load_test_data(self)
|
||||
self.mox = mox.Mox()
|
||||
|
||||
self._real_get_user = utils.get_user
|
||||
|
|
|
@ -3,7 +3,7 @@ import os
|
|||
from django.utils.translation import ugettext_lazy as _ # noqa
|
||||
|
||||
from horizon.test.settings import * # noqa
|
||||
from horizon.utils.secret_key import generate_or_read_from_file # noqa
|
||||
from horizon.utils import secret_key
|
||||
|
||||
from openstack_dashboard import exceptions
|
||||
|
||||
|
@ -11,8 +11,8 @@ from openstack_dashboard import exceptions
|
|||
TEST_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
ROOT_PATH = os.path.abspath(os.path.join(TEST_DIR, ".."))
|
||||
|
||||
SECRET_KEY = generate_or_read_from_file(os.path.join(TEST_DIR,
|
||||
'.secret_key_store'))
|
||||
SECRET_KEY = secret_key.generate_or_read_from_file(
|
||||
os.path.join(TEST_DIR, '.secret_key_store'))
|
||||
ROOT_URLCONF = 'openstack_dashboard.urls'
|
||||
TEMPLATE_DIRS = (
|
||||
os.path.join(TEST_DIR, 'templates'),
|
||||
|
|
Loading…
Reference in New Issue