Add Hacking checks
Change-Id: I5435e83a8dbe3c3273b59ecb3c5f1be26c9bec96
This commit is contained in:
@@ -81,7 +81,7 @@ class UpdateDomainCommand(base.UpdateCommand):
|
|||||||
return parser
|
return parser
|
||||||
|
|
||||||
def execute(self, parsed_args):
|
def execute(self, parsed_args):
|
||||||
# TODO: API needs updating.. this get is silly
|
# TODO(kiall): API needs updating.. this get is silly
|
||||||
domain = self.client.domains.get(parsed_args.id)
|
domain = self.client.domains.get(parsed_args.id)
|
||||||
|
|
||||||
if parsed_args.name:
|
if parsed_args.name:
|
||||||
|
@@ -107,7 +107,7 @@ class UpdateRecordCommand(base.UpdateCommand):
|
|||||||
return parser
|
return parser
|
||||||
|
|
||||||
def execute(self, parsed_args):
|
def execute(self, parsed_args):
|
||||||
# TODO: API needs updating.. this get is silly
|
# TODO(kiall): API needs updating.. this get is silly
|
||||||
record = self.client.records.get(parsed_args.domain_id, parsed_args.id)
|
record = self.client.records.get(parsed_args.domain_id, parsed_args.id)
|
||||||
|
|
||||||
if parsed_args.name:
|
if parsed_args.name:
|
||||||
|
@@ -73,7 +73,7 @@ class UpdateServerCommand(base.UpdateCommand):
|
|||||||
return parser
|
return parser
|
||||||
|
|
||||||
def execute(self, parsed_args):
|
def execute(self, parsed_args):
|
||||||
# TODO: API needs updating.. this get is silly
|
# TODO(kiall): API needs updating.. this get is silly
|
||||||
server = self.client.servers.get(parsed_args.id)
|
server = self.client.servers.get(parsed_args.id)
|
||||||
|
|
||||||
if parsed_args.name:
|
if parsed_args.name:
|
||||||
|
@@ -24,13 +24,15 @@ class ResourceNotFound(Base):
|
|||||||
|
|
||||||
|
|
||||||
class RemoteError(Base):
|
class RemoteError(Base):
|
||||||
def __init__(self, message=None, code=None, type=None, errors=None):
|
def __init__(self, message=None, code=None, type=None, errors=None,
|
||||||
|
request_id=None):
|
||||||
super(RemoteError, self).__init__(message)
|
super(RemoteError, self).__init__(message)
|
||||||
|
|
||||||
self.message = message
|
self.message = message
|
||||||
self.code = code
|
self.code = code
|
||||||
self.type = type
|
self.type = type
|
||||||
self.errors = errors
|
self.errors = errors
|
||||||
|
self.request_id = request_id
|
||||||
|
|
||||||
|
|
||||||
class Unknown(RemoteError):
|
class Unknown(RemoteError):
|
||||||
|
@@ -1,4 +1,14 @@
|
|||||||
flake8
|
# Packages needed for dev testing
|
||||||
|
distribute>=0.6.24
|
||||||
|
|
||||||
|
# Install bounded pep8/pyflakes first, then let flake8 install
|
||||||
|
pep8==1.4.5
|
||||||
|
pyflakes==0.7.2
|
||||||
|
flake8==2.0
|
||||||
|
hacking>=0.5.3,<0.6
|
||||||
|
|
||||||
|
coverage>=3.6
|
||||||
|
|
||||||
mox
|
mox
|
||||||
python-subunit
|
python-subunit
|
||||||
sphinx
|
sphinx
|
||||||
|
15
tox.ini
15
tox.ini
@@ -1,8 +1,9 @@
|
|||||||
[tox]
|
[tox]
|
||||||
envlist = py26,py27,pep8
|
envlist = py26,py27,flake8
|
||||||
minversion = 1.4.0
|
minversion = 1.4.0
|
||||||
|
|
||||||
[testenv]
|
[testenv]
|
||||||
|
sitepackages = False
|
||||||
setenv = VIRTUAL_ENV={envdir}
|
setenv = VIRTUAL_ENV={envdir}
|
||||||
LANG=en_US.UTF-8
|
LANG=en_US.UTF-8
|
||||||
LANGUAGE=en_US:en
|
LANGUAGE=en_US:en
|
||||||
@@ -11,15 +12,19 @@ deps = -r{toxinidir}/requirements.txt
|
|||||||
-r{toxinidir}/test-requirements.txt
|
-r{toxinidir}/test-requirements.txt
|
||||||
commands =
|
commands =
|
||||||
python setup.py testr --testr-args='{posargs}'
|
python setup.py testr --testr-args='{posargs}'
|
||||||
sitepackages = False
|
|
||||||
|
|
||||||
|
|
||||||
[tox:jenkins]
|
[tox:jenkins]
|
||||||
downloadcache = ~/cache/pip
|
downloadcache = ~/cache/pip
|
||||||
|
|
||||||
|
[testenv:flake8]
|
||||||
|
commands = flake8
|
||||||
|
|
||||||
[testenv:pep8]
|
[testenv:pep8]
|
||||||
commands = flake8
|
commands = flake8
|
||||||
|
|
||||||
|
[testenv:pyflakes]
|
||||||
|
commands = flake8
|
||||||
|
|
||||||
[testenv:cover]
|
[testenv:cover]
|
||||||
commands = python setup.py testr --coverage --testr-args='{posargs}'
|
commands = python setup.py testr --coverage --testr-args='{posargs}'
|
||||||
|
|
||||||
@@ -27,6 +32,6 @@ commands = python setup.py testr --coverage --testr-args='{posargs}'
|
|||||||
commands = {posargs}
|
commands = {posargs}
|
||||||
|
|
||||||
[flake8]
|
[flake8]
|
||||||
ignore = E12,E711,E721,E712,F,H302
|
ignore = H302,H306,H401,H402,H404
|
||||||
show-source = True
|
builtins = _
|
||||||
exclude = .venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build,tools
|
exclude = .venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build,tools
|
||||||
|
Reference in New Issue
Block a user