From fb3c01bd38dd25df7407a628ed10b2cf6c3d85c1 Mon Sep 17 00:00:00 2001 From: Ilya Sviridov Date: Thu, 29 Aug 2013 16:03:29 +0300 Subject: [PATCH] pep8 checking was added for bin folder Change-Id: I9b3a8928fb1d0e9c00361e90dcdcd2eb09e8e44b Closes-Bug: #1218364 --- bin/trove-api | 4 ++-- bin/trove-api-os-database | 14 ++++++-------- bin/trove-cli | 2 +- bin/trove-guestagent | 4 ++-- bin/trove-manage | 8 ++++---- bin/trove-mgmt-taskmanager | 4 ++-- bin/trove-server | 17 +++++++---------- bin/trove-taskmanager | 4 ++-- tox.ini | 3 ++- 9 files changed, 28 insertions(+), 32 deletions(-) diff --git a/bin/trove-api b/bin/trove-api index 1ff98f94a2..88aa25fce4 100755 --- a/bin/trove-api +++ b/bin/trove-api @@ -28,8 +28,8 @@ gettext.install('trove', unicode=1) # 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... 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')): sys.path.insert(0, possible_topdir) diff --git a/bin/trove-api-os-database b/bin/trove-api-os-database index c5b3840604..1c84cfed5b 100755 --- a/bin/trove-api-os-database +++ b/bin/trove-api-os-database @@ -27,7 +27,7 @@ import sys 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")): 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 # as the name of the service cfg.IntOpt('%s_listen_port' % SERVICE_NAME, - default=8779, - help='Trove API default port'), + default=8779, + help='Trove API default port'), cfg.MultiStrOpt('trove_api_extension', - default=[ - 'trove.api.database.contrib.standard_extensions' - ], - help='osapi compute extension to load'), - ] + default=['trove.api.database.contrib.standard_extensions'], + help='osapi compute extension to load'), ] + FLAGS = flags.FLAGS FLAGS.register_opts(trove_opts) diff --git a/bin/trove-cli b/bin/trove-cli index 04d8c93492..fc30e03d4f 100755 --- a/bin/trove-cli +++ b/bin/trove-cli @@ -288,7 +288,7 @@ def main(): print "Possible wrong number of arguments supplied." print "%s %s: %s" % (cmd, action, fn.__doc__) 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 except Exception: print "Command failed, please check the log for more info." diff --git a/bin/trove-guestagent b/bin/trove-guestagent index 4e654da113..797f60b118 100755 --- a/bin/trove-guestagent +++ b/bin/trove-guestagent @@ -31,8 +31,8 @@ gettext.install('trove', unicode=1) # 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... 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')): sys.path.insert(0, possible_topdir) diff --git a/bin/trove-manage b/bin/trove-manage index 4938dff036..defae03d7f 100755 --- a/bin/trove-manage +++ b/bin/trove-manage @@ -29,8 +29,8 @@ gettext.install('trove', unicode=1) # 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... 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')): sys.path.insert(0, possible_topdir) @@ -72,7 +72,7 @@ class Commands(object): def image_update(self, service_name, image_id): self.db_api.configure_db(CONF) image = self.db_api.find_by(instance_models.ServiceImage, - service_name=service_name) + service_name=service_name) if image is None: # Create a new one image = instance_models.ServiceImage() @@ -121,7 +121,7 @@ if __name__ == '__main__': try: logging.setup(None) - + Commands().execute() sys.exit(0) except TypeError as e: diff --git a/bin/trove-mgmt-taskmanager b/bin/trove-mgmt-taskmanager index 2145d68817..075ec5e644 100755 --- a/bin/trove-mgmt-taskmanager +++ b/bin/trove-mgmt-taskmanager @@ -31,8 +31,8 @@ gettext.install('trove', unicode=1) # 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... 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')): sys.path.insert(0, possible_topdir) diff --git a/bin/trove-server b/bin/trove-server index bbc79d49fa..4b593402df 100755 --- a/bin/trove-server +++ b/bin/trove-server @@ -28,8 +28,8 @@ gettext.install('trove', unicode=1) # 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... 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')): sys.path.insert(0, possible_topdir) @@ -41,13 +41,13 @@ from trove.db import get_db_api extra_opts = [ openstack_cfg.BoolOpt('fork', - short='f', - default=False, - dest='fork'), + short='f', + default=False, + dest='fork'), openstack_cfg.StrOpt('pid-file', - default='.pid'), + default='.pid'), openstack_cfg.StrOpt('override-logfile', - default=None), + default=None), ] CONF = cfg.CONF @@ -61,8 +61,6 @@ def run_server(): launcher = wsgi.launch('trove', CONF.bind_port or 8779, conf_file, workers=CONF.trove_api_workers) - - launcher.wait() except RuntimeError as error: import traceback @@ -89,4 +87,3 @@ if __name__ == '__main__': f.write(str(pid)) else: run_server() - diff --git a/bin/trove-taskmanager b/bin/trove-taskmanager index 6d958e7922..8a72980ef7 100755 --- a/bin/trove-taskmanager +++ b/bin/trove-taskmanager @@ -31,8 +31,8 @@ gettext.install('trove', unicode=1) # 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... 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')): sys.path.insert(0, possible_topdir) diff --git a/tox.ini b/tox.ini index 6636dba140..c42b9dc037 100644 --- a/tox.ini +++ b/tox.ini @@ -35,4 +35,5 @@ commands = {posargs} show-source = True ignore = E125,F401,F403,F811,F821,F841,H102,H103,H201,H23,H301,H306,H401,H402,H403,H404,H702,H703 builtins = _ -exclude=.venv,.tox,dist,doc,openstack,*egg,rsdns,tools +exclude=.venv,.tox,dist,doc,openstack,*egg,rsdns,tools,etc +filename=*.py,trove-* \ No newline at end of file