pep8 checking was added for bin folder

Change-Id: I9b3a8928fb1d0e9c00361e90dcdcd2eb09e8e44b
Closes-Bug: #1218364
This commit is contained in:
Ilya Sviridov 2013-08-29 16:03:29 +03:00
parent 2538755e9b
commit fb3c01bd38
9 changed files with 28 additions and 32 deletions

View File

@ -28,8 +28,8 @@ gettext.install('trove', unicode=1)
# If ../trove/__init__.py exists, add ../ to Python search path, so that # If ../trove/__init__.py exists, add ../ to Python search path, so that
# it will override what happens to be installed in /usr/(local/)lib/python... # it will override what happens to be installed in /usr/(local/)lib/python...
possible_topdir = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]), possible_topdir = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]),
os.pardir, os.pardir,
os.pardir)) os.pardir))
if os.path.exists(os.path.join(possible_topdir, 'trove', '__init__.py')): if os.path.exists(os.path.join(possible_topdir, 'trove', '__init__.py')):
sys.path.insert(0, possible_topdir) sys.path.insert(0, possible_topdir)

View File

@ -27,7 +27,7 @@ import sys
possible_topdir = os.path.normpath(os.path.join(os.path.abspath( possible_topdir = os.path.normpath(os.path.join(os.path.abspath(
sys.argv[0]), os.pardir, os.pardir)) sys.argv[0]), os.pardir, os.pardir))
if os.path.exists(os.path.join(possible_topdir, "nova", "__init__.py")): if os.path.exists(os.path.join(possible_topdir, "nova", "__init__.py")):
sys.path.insert(0, possible_topdir) sys.path.insert(0, possible_topdir)
@ -47,14 +47,12 @@ trove_opts = [
# port magic in service.WSGIService the name of the app has to be the same # port magic in service.WSGIService the name of the app has to be the same
# as the name of the service # as the name of the service
cfg.IntOpt('%s_listen_port' % SERVICE_NAME, cfg.IntOpt('%s_listen_port' % SERVICE_NAME,
default=8779, default=8779,
help='Trove API default port'), help='Trove API default port'),
cfg.MultiStrOpt('trove_api_extension', cfg.MultiStrOpt('trove_api_extension',
default=[ default=['trove.api.database.contrib.standard_extensions'],
'trove.api.database.contrib.standard_extensions' help='osapi compute extension to load'), ]
],
help='osapi compute extension to load'),
]
FLAGS = flags.FLAGS FLAGS = flags.FLAGS
FLAGS.register_opts(trove_opts) FLAGS.register_opts(trove_opts)

View File

@ -288,7 +288,7 @@ def main():
print "Possible wrong number of arguments supplied." print "Possible wrong number of arguments supplied."
print "%s %s: %s" % (cmd, action, fn.__doc__) print "%s %s: %s" % (cmd, action, fn.__doc__)
print "\t\t", [fn.func_code.co_varnames[i] for i in print "\t\t", [fn.func_code.co_varnames[i] for i in
range(fn.func_code.co_argcount)] range(fn.func_code.co_argcount)]
print "ERROR: %s" % err print "ERROR: %s" % err
except Exception: except Exception:
print "Command failed, please check the log for more info." print "Command failed, please check the log for more info."

View File

@ -31,8 +31,8 @@ gettext.install('trove', unicode=1)
# If ../trove/__init__.py exists, add ../ to Python search path, so that # If ../trove/__init__.py exists, add ../ to Python search path, so that
# it will override what happens to be installed in /usr/(local/)lib/python... # it will override what happens to be installed in /usr/(local/)lib/python...
possible_topdir = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]), possible_topdir = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]),
os.pardir, os.pardir,
os.pardir)) os.pardir))
if os.path.exists(os.path.join(possible_topdir, 'trove', '__init__.py')): if os.path.exists(os.path.join(possible_topdir, 'trove', '__init__.py')):
sys.path.insert(0, possible_topdir) sys.path.insert(0, possible_topdir)

View File

@ -29,8 +29,8 @@ gettext.install('trove', unicode=1)
# If ../trove/__init__.py exists, add ../ to Python search path, so that # If ../trove/__init__.py exists, add ../ to Python search path, so that
# it will override what happens to be installed in /usr/(local/)lib/python... # it will override what happens to be installed in /usr/(local/)lib/python...
possible_topdir = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]), possible_topdir = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]),
os.pardir, os.pardir,
os.pardir)) os.pardir))
if os.path.exists(os.path.join(possible_topdir, 'trove', '__init__.py')): if os.path.exists(os.path.join(possible_topdir, 'trove', '__init__.py')):
sys.path.insert(0, possible_topdir) sys.path.insert(0, possible_topdir)
@ -72,7 +72,7 @@ class Commands(object):
def image_update(self, service_name, image_id): def image_update(self, service_name, image_id):
self.db_api.configure_db(CONF) self.db_api.configure_db(CONF)
image = self.db_api.find_by(instance_models.ServiceImage, image = self.db_api.find_by(instance_models.ServiceImage,
service_name=service_name) service_name=service_name)
if image is None: if image is None:
# Create a new one # Create a new one
image = instance_models.ServiceImage() image = instance_models.ServiceImage()
@ -121,7 +121,7 @@ if __name__ == '__main__':
try: try:
logging.setup(None) logging.setup(None)
Commands().execute() Commands().execute()
sys.exit(0) sys.exit(0)
except TypeError as e: except TypeError as e:

View File

@ -31,8 +31,8 @@ gettext.install('trove', unicode=1)
# If ../trove/__init__.py exists, add ../ to Python search path, so that # If ../trove/__init__.py exists, add ../ to Python search path, so that
# it will override what happens to be installed in /usr/(local/)lib/python... # it will override what happens to be installed in /usr/(local/)lib/python...
possible_topdir = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]), possible_topdir = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]),
os.pardir, os.pardir,
os.pardir)) os.pardir))
if os.path.exists(os.path.join(possible_topdir, 'trove', '__init__.py')): if os.path.exists(os.path.join(possible_topdir, 'trove', '__init__.py')):
sys.path.insert(0, possible_topdir) sys.path.insert(0, possible_topdir)

View File

@ -28,8 +28,8 @@ gettext.install('trove', unicode=1)
# If ../trove/__init__.py exists, add ../ to Python search path, so that # If ../trove/__init__.py exists, add ../ to Python search path, so that
# it will override what happens to be installed in /usr/(local/)lib/python... # it will override what happens to be installed in /usr/(local/)lib/python...
possible_topdir = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]), possible_topdir = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]),
os.pardir, os.pardir,
os.pardir)) os.pardir))
if os.path.exists(os.path.join(possible_topdir, 'trove', '__init__.py')): if os.path.exists(os.path.join(possible_topdir, 'trove', '__init__.py')):
sys.path.insert(0, possible_topdir) sys.path.insert(0, possible_topdir)
@ -41,13 +41,13 @@ from trove.db import get_db_api
extra_opts = [ extra_opts = [
openstack_cfg.BoolOpt('fork', openstack_cfg.BoolOpt('fork',
short='f', short='f',
default=False, default=False,
dest='fork'), dest='fork'),
openstack_cfg.StrOpt('pid-file', openstack_cfg.StrOpt('pid-file',
default='.pid'), default='.pid'),
openstack_cfg.StrOpt('override-logfile', openstack_cfg.StrOpt('override-logfile',
default=None), default=None),
] ]
CONF = cfg.CONF CONF = cfg.CONF
@ -61,8 +61,6 @@ def run_server():
launcher = wsgi.launch('trove', CONF.bind_port or 8779, conf_file, launcher = wsgi.launch('trove', CONF.bind_port or 8779, conf_file,
workers=CONF.trove_api_workers) workers=CONF.trove_api_workers)
launcher.wait() launcher.wait()
except RuntimeError as error: except RuntimeError as error:
import traceback import traceback
@ -89,4 +87,3 @@ if __name__ == '__main__':
f.write(str(pid)) f.write(str(pid))
else: else:
run_server() run_server()

View File

@ -31,8 +31,8 @@ gettext.install('trove', unicode=1)
# If ../trove/__init__.py exists, add ../ to Python search path, so that # If ../trove/__init__.py exists, add ../ to Python search path, so that
# it will override what happens to be installed in /usr/(local/)lib/python... # it will override what happens to be installed in /usr/(local/)lib/python...
possible_topdir = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]), possible_topdir = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]),
os.pardir, os.pardir,
os.pardir)) os.pardir))
if os.path.exists(os.path.join(possible_topdir, 'trove', '__init__.py')): if os.path.exists(os.path.join(possible_topdir, 'trove', '__init__.py')):
sys.path.insert(0, possible_topdir) sys.path.insert(0, possible_topdir)

View File

@ -35,4 +35,5 @@ commands = {posargs}
show-source = True show-source = True
ignore = E125,F401,F403,F811,F821,F841,H102,H103,H201,H23,H301,H306,H401,H402,H403,H404,H702,H703 ignore = E125,F401,F403,F811,F821,F841,H102,H103,H201,H23,H301,H306,H401,H402,H403,H404,H702,H703
builtins = _ builtins = _
exclude=.venv,.tox,dist,doc,openstack,*egg,rsdns,tools exclude=.venv,.tox,dist,doc,openstack,*egg,rsdns,tools,etc
filename=*.py,trove-*