From d4ada3e555610df5dafd5a41be49d14e17f2a1be Mon Sep 17 00:00:00 2001 From: Sergey Lukjanov Date: Mon, 24 Jun 2013 11:35:09 +0400 Subject: [PATCH] Enable hacking H101 test H101 Use TODO(NAME) Change-Id: Ic30decbf72ac43845bf5b24fe4eead341bf1d2d5 --- openstack_dashboard/api/base.py | 5 +++-- openstack_dashboard/api/keystone.py | 2 +- openstack_dashboard/dashboards/admin/groups/forms.py | 3 ++- openstack_dashboard/dashboards/admin/groups/tables.py | 4 ++-- tox.ini | 3 +-- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/openstack_dashboard/api/base.py b/openstack_dashboard/api/base.py index ff227f6f1..ebc6dad60 100644 --- a/openstack_dashboard/api/base.py +++ b/openstack_dashboard/api/base.py @@ -58,8 +58,9 @@ class APIVersionManager(object): return self.supported[self._active] key = getattr(settings, self.SETTINGS_KEY, {}).get(self.service_type) if key is None: - # TODO: support API version discovery here; we'll leave the setting - # in as a way of overriding the latest available version. + # TODO(gabriel): support API version discovery here; we'll leave + # the setting in as a way of overriding the latest available + # version. key = self.preferred self._active = key return self.supported[self._active] diff --git a/openstack_dashboard/api/keystone.py b/openstack_dashboard/api/keystone.py index 458d1c38f..5fd93c062 100644 --- a/openstack_dashboard/api/keystone.py +++ b/openstack_dashboard/api/keystone.py @@ -104,7 +104,7 @@ def _get_endpoint_url(request, endpoint_type, catalog=None): auth_url = getattr(settings, 'OPENSTACK_KEYSTONE_URL') url = request.session.get('region_endpoint', auth_url) - # TODO: When the Service Catalog no longer contains API versions + # TODO(gabriel): When the Service Catalog no longer contains API versions # in the endpoints this can be removed. bits = urlparse.urlparse(url) root = "://".join((bits.scheme, bits.netloc)) diff --git a/openstack_dashboard/dashboards/admin/groups/forms.py b/openstack_dashboard/dashboards/admin/groups/forms.py index edb7d578d..51c478a25 100644 --- a/openstack_dashboard/dashboards/admin/groups/forms.py +++ b/openstack_dashboard/dashboards/admin/groups/forms.py @@ -38,7 +38,8 @@ class CreateGroupForm(forms.SelfHandlingForm): def handle(self, request, data): try: LOG.info('Creating group with name "%s"' % data['name']) - # TODO: Set the domain_id with the value from the Domain scope. + # TODO(lin-hua-cheng): Set the domain_id with the value from the + # Domain scope. new_group = api.keystone.group_create( request, domain_id=None, diff --git a/openstack_dashboard/dashboards/admin/groups/tables.py b/openstack_dashboard/dashboards/admin/groups/tables.py index 5c6930808..ca263f880 100644 --- a/openstack_dashboard/dashboards/admin/groups/tables.py +++ b/openstack_dashboard/dashboards/admin/groups/tables.py @@ -135,7 +135,7 @@ class RemoveMembers(tables.DeleteAction): api.keystone.remove_group_user(request, group_id=group_id, user_id=user_obj.id) - # TODO: Fix the bug when removing current user + # TODO(lin-hua-cheng): Fix the bug when removing current user # Keystone revokes the token of the user removed from the group. # If the logon user was removed, redirect the user to logout. @@ -192,7 +192,7 @@ class AddMembers(tables.BatchAction): api.keystone.add_group_user(request, group_id=group_id, user_id=user_obj.id) - # TODO: Fix the bug when adding current user + # TODO(lin-hua-cheng): Fix the bug when adding current user # Keystone revokes the token of the user added to the group. # If the logon user was added, redirect the user to logout. diff --git a/tox.ini b/tox.ini index ca71f1dec..edc2054b0 100644 --- a/tox.ini +++ b/tox.ini @@ -42,7 +42,6 @@ exclude = .venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build,p # F821 undefined name '' # F841 local variable '' is assigned to but never used # F999 syntax error in doctest -# H101 Use TODO(NAME) # H201 no 'except:' at least use 'except Exception:' # H302 import only modules.'from optparse import make_option' does not import a module # H303 No wildcard (*) import. @@ -51,4 +50,4 @@ exclude = .venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build,p # H4xx docstrings # H701 empty localization string # H702 Formatting operation should be outside of localization method call -ignore = E121,E126,E127,E128,F403,F811,F821,F841,F999,H101,H201,H302,H303,H304,H306,H4,H701,H702 +ignore = E121,E126,E127,E128,F403,F811,F821,F841,F999,H201,H302,H303,H304,H306,H4,H701,H702