Enable H302 check
This patch replaces some method imports with module imports and makes H302 test enabled. Fixes bug 1188531 Change-Id: Ibfbddeaa19cbbb244da58ffd5c918c41f03a0c65
This commit is contained in:
@@ -21,7 +21,7 @@
|
||||
import re
|
||||
|
||||
from django.core import validators
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.utils.translation import ugettext_lazy as _ # noqa
|
||||
|
||||
from horizon import exceptions
|
||||
from horizon import forms
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
import logging
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.utils.translation import ugettext_lazy as _ # noqa
|
||||
|
||||
from horizon import tables
|
||||
|
||||
|
||||
@@ -18,10 +18,10 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.core.urlresolvers import reverse # noqa
|
||||
from django import http
|
||||
|
||||
from mox import IsA
|
||||
from mox import IsA # noqa
|
||||
|
||||
from openstack_dashboard import api
|
||||
from openstack_dashboard.test import helpers as test
|
||||
|
||||
@@ -18,24 +18,18 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from django.conf.urls.defaults import patterns
|
||||
from django.conf.urls.defaults import url
|
||||
from django.conf.urls.defaults import patterns # noqa
|
||||
from django.conf.urls.defaults import url # noqa
|
||||
|
||||
from openstack_dashboard.dashboards.project.access_and_security.\
|
||||
keypairs.views import CreateView
|
||||
from openstack_dashboard.dashboards.project.access_and_security.\
|
||||
keypairs.views import DownloadView
|
||||
from openstack_dashboard.dashboards.project.access_and_security.\
|
||||
keypairs.views import GenerateView
|
||||
from openstack_dashboard.dashboards.project.access_and_security.\
|
||||
keypairs.views import ImportView
|
||||
from openstack_dashboard.dashboards.project.access_and_security.keypairs \
|
||||
import views
|
||||
|
||||
|
||||
urlpatterns = patterns('',
|
||||
url(r'^create/$', CreateView.as_view(), name='create'),
|
||||
url(r'^import/$', ImportView.as_view(), name='import'),
|
||||
url(r'^(?P<keypair_name>[^/]+)/download/$', DownloadView.as_view(),
|
||||
url(r'^create/$', views.CreateView.as_view(), name='create'),
|
||||
url(r'^import/$', views.ImportView.as_view(), name='import'),
|
||||
url(r'^(?P<keypair_name>[^/]+)/download/$', views.DownloadView.as_view(),
|
||||
name='download'),
|
||||
url(r'^(?P<keypair_name>[^/]+)/generate/$', GenerateView.as_view(),
|
||||
url(r'^(?P<keypair_name>[^/]+)/generate/$', views.GenerateView.as_view(),
|
||||
name='generate'),
|
||||
)
|
||||
|
||||
@@ -23,30 +23,28 @@ Views for managing keypairs.
|
||||
"""
|
||||
import logging
|
||||
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.core.urlresolvers import reverse_lazy
|
||||
from django.core.urlresolvers import reverse # noqa
|
||||
from django.core.urlresolvers import reverse_lazy # noqa
|
||||
from django import http
|
||||
from django.template.defaultfilters import slugify
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.views.generic import TemplateView
|
||||
from django.views.generic import View
|
||||
from django.template.defaultfilters import slugify # noqa
|
||||
from django.utils.translation import ugettext_lazy as _ # noqa
|
||||
from django.views.generic import TemplateView # noqa
|
||||
from django.views.generic import View # noqa
|
||||
|
||||
from horizon import exceptions
|
||||
from horizon import forms
|
||||
|
||||
from openstack_dashboard import api
|
||||
|
||||
from openstack_dashboard.dashboards.project.access_and_security.\
|
||||
keypairs.forms import CreateKeypair
|
||||
from openstack_dashboard.dashboards.project.access_and_security.\
|
||||
keypairs.forms import ImportKeypair
|
||||
from openstack_dashboard.dashboards.project.access_and_security.keypairs \
|
||||
import forms as project_forms
|
||||
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class CreateView(forms.ModalFormView):
|
||||
form_class = CreateKeypair
|
||||
form_class = project_forms.CreateKeypair
|
||||
template_name = 'project/access_and_security/keypairs/create.html'
|
||||
success_url = 'horizon:project:access_and_security:keypairs:download'
|
||||
|
||||
@@ -56,7 +54,7 @@ class CreateView(forms.ModalFormView):
|
||||
|
||||
|
||||
class ImportView(forms.ModalFormView):
|
||||
form_class = ImportKeypair
|
||||
form_class = project_forms.ImportKeypair
|
||||
template_name = 'project/access_and_security/keypairs/import.html'
|
||||
success_url = reverse_lazy('horizon:project:access_and_security:index')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user