Start using Hacking and PyFlakes
Only blacklisting those warnings that are numerous, so that in principle Hacking and PyFlakes warnings are tested. Fix the easy ones alongway. Change-Id: I571f51ebf570ac114509f2dcd71cdce281e7c70a
This commit is contained in:
parent
def5df2760
commit
67c80558b1
@ -50,7 +50,7 @@ class ServiceCatalog(object):
|
||||
raise novaclient.exceptions.EndpointNotFound()
|
||||
|
||||
# We don't always get a service catalog back ...
|
||||
if not 'serviceCatalog' in self.catalog['access']:
|
||||
if 'serviceCatalog' not in self.catalog['access']:
|
||||
return None
|
||||
|
||||
# Full catalog ...
|
||||
|
@ -169,9 +169,9 @@ class ServersTest(utils.TestCase):
|
||||
{'metadata': {'test_key': 'test_value'}})
|
||||
|
||||
def test_find(self):
|
||||
s = cs.servers.find(name='sample-server')
|
||||
server = cs.servers.find(name='sample-server')
|
||||
cs.assert_called('GET', '/servers/detail')
|
||||
self.assertEqual(s.name, 'sample-server')
|
||||
self.assertEqual(server.name, 'sample-server')
|
||||
|
||||
self.assertRaises(exceptions.NoUniqueMatch, cs.servers.find,
|
||||
flavor={"id": 1, "name": "256 MB Server"})
|
||||
|
@ -14,4 +14,4 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from novaclient.v1_1.client import Client
|
||||
from novaclient.v1_1.client import Client # noqa
|
||||
|
@ -170,7 +170,7 @@ class FlavorManager(base.ManagerWithFind):
|
||||
|
||||
try:
|
||||
is_public = utils.bool_from_str(is_public)
|
||||
except:
|
||||
except Exception:
|
||||
raise exceptions.CommandError("is_public must be a boolean.")
|
||||
|
||||
body = {
|
||||
|
@ -536,7 +536,7 @@ class ServerManager(local_base.BootingManagerWithFind):
|
||||
key_name=None, availability_zone=None,
|
||||
block_device_mapping=None, nics=None, scheduler_hints=None,
|
||||
config_drive=None, **kwargs):
|
||||
# TODO: (anthony) indicate in doc string if param is an extension
|
||||
# TODO(anthony): indicate in doc string if param is an extension
|
||||
# and/or optional
|
||||
"""
|
||||
Create (boot) a new server.
|
||||
|
@ -3127,7 +3127,7 @@ def do_availability_zone_list(cs, _args):
|
||||
except exceptions.Forbidden as e: # policy doesn't allow probably
|
||||
try:
|
||||
availability_zones = cs.availability_zones.list(detailed=False)
|
||||
except:
|
||||
except Exception:
|
||||
raise e
|
||||
|
||||
result = []
|
||||
|
@ -27,7 +27,6 @@ import optparse
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
import platform
|
||||
|
||||
|
||||
ROOT = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
|
||||
|
2
tox.ini
2
tox.ini
@ -24,6 +24,6 @@ commands = python setup.py testr --coverage --testr-args='{posargs}'
|
||||
downloadcache = ~/cache/pip
|
||||
|
||||
[flake8]
|
||||
ignore = E12,E711,E721,E712,F,H
|
||||
ignore = E12,E711,E721,E712,F841,F811,F821,H302,H306,H402,H403,H404
|
||||
show-source = True
|
||||
exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build
|
||||
|
Loading…
Reference in New Issue
Block a user