Fix all but H302 hacking rules.
Change-Id: Iac329617428b851df42579d5bd0b299d2f6e2c0a
This commit is contained in:
@@ -29,7 +29,8 @@ except NameError:
|
|||||||
|
|
||||||
|
|
||||||
def getid(obj):
|
def getid(obj):
|
||||||
"""
|
"""Get by object or ID.
|
||||||
|
|
||||||
Abstracts the common pattern of allowing both an object or an object's ID
|
Abstracts the common pattern of allowing both an object or an object's ID
|
||||||
(UUID) as a parameter when dealing with relationships.
|
(UUID) as a parameter when dealing with relationships.
|
||||||
"""
|
"""
|
||||||
@@ -40,9 +41,10 @@ def getid(obj):
|
|||||||
|
|
||||||
|
|
||||||
class Manager(object):
|
class Manager(object):
|
||||||
"""
|
"""Managers interact with a particular type of API.
|
||||||
Managers interact with a particular type of API (servers, flavors, images,
|
|
||||||
etc.) and provide CRUD operations for them.
|
For example servers, flavors and images.
|
||||||
|
It provides CRUD operations for these objects.
|
||||||
"""
|
"""
|
||||||
resource_class = None
|
resource_class = None
|
||||||
|
|
||||||
@@ -69,9 +71,9 @@ class Manager(object):
|
|||||||
|
|
||||||
|
|
||||||
class Resource(object):
|
class Resource(object):
|
||||||
"""
|
"""A resource represents a particular instance of an object.
|
||||||
A resource represents a particular instance of an object (tenant, user,
|
|
||||||
etc). This is pretty much just a bag for attributes.
|
For example tenant or user. This is pretty much just a bag for attributes.
|
||||||
|
|
||||||
:param manager: Manager object
|
:param manager: Manager object
|
||||||
:param info: dictionary representing resource attributes
|
:param info: dictionary representing resource attributes
|
||||||
|
@@ -227,8 +227,7 @@ class VerifiedHTTPSConnection(httplib.HTTPSConnection):
|
|||||||
self.insecure = insecure
|
self.insecure = insecure
|
||||||
|
|
||||||
def connect(self):
|
def connect(self):
|
||||||
"""
|
"""Connect to a host on a given (SSL) port.
|
||||||
Connect to a host on a given (SSL) port.
|
|
||||||
If ca_file is pointing somewhere, use it to check Server Certificate.
|
If ca_file is pointing somewhere, use it to check Server Certificate.
|
||||||
|
|
||||||
Redefined/copied and extended from httplib.py:1105 (Python 2.6.x).
|
Redefined/copied and extended from httplib.py:1105 (Python 2.6.x).
|
||||||
|
@@ -124,9 +124,7 @@ def exit(msg=''):
|
|||||||
|
|
||||||
|
|
||||||
def format_parameters(params):
|
def format_parameters(params):
|
||||||
'''
|
'''Reformat parameters into dict of format expected by the API.'''
|
||||||
Reformat parameters into dict of format expected by the API
|
|
||||||
'''
|
|
||||||
parameters = {}
|
parameters = {}
|
||||||
if params:
|
if params:
|
||||||
for count, p in enumerate(params.split(';'), 1):
|
for count, p in enumerate(params.split(';'), 1):
|
||||||
|
@@ -322,9 +322,7 @@ class HeatShell(object):
|
|||||||
@utils.arg('command', metavar='<subcommand>', nargs='?',
|
@utils.arg('command', metavar='<subcommand>', nargs='?',
|
||||||
help='Display help for <subcommand>')
|
help='Display help for <subcommand>')
|
||||||
def do_help(self, args):
|
def do_help(self, args):
|
||||||
"""
|
"""Display help about this program or one of its subcommands."""
|
||||||
Display help about this program or one of its subcommands.
|
|
||||||
"""
|
|
||||||
if getattr(args, 'command', None):
|
if getattr(args, 'command', None):
|
||||||
if args.command in self.subcommands:
|
if args.command in self.subcommands:
|
||||||
self.subcommands[args.command].print_help()
|
self.subcommands[args.command].print_help()
|
||||||
|
@@ -1,9 +1,9 @@
|
|||||||
import mox
|
import mox
|
||||||
import testtools
|
import testtools
|
||||||
|
|
||||||
import fakes
|
|
||||||
from heatclient.common import http
|
from heatclient.common import http
|
||||||
from heatclient import exc
|
from heatclient import exc
|
||||||
|
from heatclient.tests import fakes
|
||||||
|
|
||||||
|
|
||||||
class HttpClientTest(testtools.TestCase):
|
class HttpClientTest(testtools.TestCase):
|
||||||
|
@@ -14,9 +14,9 @@ except ImportError:
|
|||||||
import simplejson as json
|
import simplejson as json
|
||||||
from keystoneclient.v2_0 import client as ksclient
|
from keystoneclient.v2_0 import client as ksclient
|
||||||
|
|
||||||
import fakes
|
|
||||||
from heatclient import exc
|
from heatclient import exc
|
||||||
import heatclient.shell
|
import heatclient.shell
|
||||||
|
from heatclient.tests import fakes
|
||||||
from heatclient.v1 import client as v1client
|
from heatclient.v1 import client as v1client
|
||||||
|
|
||||||
load_tests = testscenarios.load_tests_apply_scenarios
|
load_tests = testscenarios.load_tests_apply_scenarios
|
||||||
|
2
tox.ini
2
tox.ini
@@ -22,6 +22,6 @@ downloadcache = ~/cache/pip
|
|||||||
|
|
||||||
[flake8]
|
[flake8]
|
||||||
show-source = True
|
show-source = True
|
||||||
ignore = H302,H303,H304,H403,H404
|
ignore = H302
|
||||||
builtins = _
|
builtins = _
|
||||||
exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build
|
exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build
|
||||||
|
Reference in New Issue
Block a user