Fix hacking and requirements

Change-Id: Ie7a36b0a7957f102b6a1195cdc7c0403cdd9545a
This commit is contained in:
Joshua Hesketh 2015-06-04 14:13:31 +10:00
parent 5ef62278f3
commit a4b178d1f1
10 changed files with 12 additions and 23 deletions

View File

@ -1,4 +1,3 @@
pbr>=0.5.21,<0.6
gear>=0.5.4,<1.0.0
python-swiftclient
python-keystoneclient

View File

@ -15,10 +15,6 @@ classifier =
Programming Language :: Python :: 2.7
Programming Language :: Python :: 2.6
[global]
setup-hooks =
pbr.hooks.setup_hook
[files]
packages =
turbo_hipster

View File

@ -1,8 +1,4 @@
# Install bounded pep8/pyflakes first, then let flake8 install
pep8==1.4.5
pyflakes==0.7.2
flake8==2.0
hacking>=0.5.6,<0.7
hacking>=0.9.2,<0.10
coverage>=3.6
sphinx>=1.1.2,!=1.2.0,!=1.3b1,<1.3

View File

@ -136,7 +136,7 @@ class TestTaskRunner(base.TestWithGearman):
def side_effect():
raise Exception('check results failed!')
#ShellTask._parse_and_check_results = _fake_parse_and_check_results
# ShellTask._parse_and_check_results = _fake_parse_and_check_results
mocked_parse_and_check_results.side_effect = side_effect
self.start_server()

View File

@ -33,8 +33,7 @@ from turbo_hipster.task_plugins.real_db_upgrade import handle_results
def main():
parser = argparse.ArgumentParser()
parser.add_argument('-c', '--config',
default=
'/etc/turbo-hipster/config.yaml',
default='/etc/turbo-hipster/config.yaml',
help='Path to yaml config file.')
args = parser.parse_args()
@ -82,7 +81,7 @@ def main():
if cursor.rowcount == 0:
for engine, dataset, migration in process(
connection, swift_config['container'], item['name']):
if not 'duration' in migration:
if 'duration' not in migration:
continue
if migration['stats']:
@ -145,9 +144,9 @@ def process(connection, container, name):
log.warn('Log %s contained no migrations' % name)
for migration in lp.migrations:
if not 'start' in migration:
if 'start' not in migration:
continue
if not 'end' in migration:
if 'end' not in migration:
continue
yield (engine_name, test_name, migration)

View File

@ -116,7 +116,7 @@ def process_dataset(dataset):
math.ceil(recommend)
# Innodb stats
if not migration in stats_summary:
if migration not in stats_summary:
continue
for stats_key in ['XInnodb_rows_changed', 'Innodb_rows_read']:

View File

@ -65,8 +65,7 @@ def main():
os.path.join(os.path.dirname(__file__), '../')))
parser = argparse.ArgumentParser()
parser.add_argument('-c', '--config',
default=
'/etc/turbo-hipster/config.yaml',
default='/etc/turbo-hipster/config.yaml',
help='Path to yaml config file.')
parser.add_argument('-b', '--background', action='store_true',
help='Run as a daemon in the background.')

View File

@ -48,7 +48,7 @@ class Task(object):
self.log_handler.flush()
self.log_handler.close()
if ('shutdown-th' in self.job_config and
self.job_config['shutdown-th']):
self.job_config['shutdown-th']):
self.worker_server.shutdown_gracefully()
def _reset(self):

View File

@ -188,7 +188,7 @@ def check_log_file(log_file, git_path, dataset):
migration.setdefault('stats', {})
# check migration completed
if not 'duration' in migration:
if 'duration' not in migration:
success = False
messages.append('WARNING - Migration %s->%s failed to complete'
% (migration['from'], migration['to']))

View File

@ -84,7 +84,7 @@ class ZuulManager(threading.Thread):
self.log.debug("Waiting for server")
self.gearman_worker.waitForServer()
if (not self.stopped() and self.gearman_worker.running and
self.gearman_worker.active_connections):
self.gearman_worker.active_connections):
self.register_functions()
self.gearman_worker.waitForServer()
logging.debug("Waiting for job")
@ -178,7 +178,7 @@ class ZuulClient(threading.Thread):
self.log.debug("Waiting for server")
self.gearman_worker.waitForServer()
if (not self.stopped() and self.gearman_worker.running and
self.gearman_worker.active_connections):
self.gearman_worker.active_connections):
self.register_functions()
self.gearman_worker.waitForServer()
self.log.debug("Waiting for job")