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 gear>=0.5.4,<1.0.0
python-swiftclient python-swiftclient
python-keystoneclient python-keystoneclient

View File

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

View File

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

View File

@ -136,7 +136,7 @@ class TestTaskRunner(base.TestWithGearman):
def side_effect(): def side_effect():
raise Exception('check results failed!') 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 mocked_parse_and_check_results.side_effect = side_effect
self.start_server() self.start_server()

View File

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

View File

@ -116,7 +116,7 @@ def process_dataset(dataset):
math.ceil(recommend) math.ceil(recommend)
# Innodb stats # Innodb stats
if not migration in stats_summary: if migration not in stats_summary:
continue continue
for stats_key in ['XInnodb_rows_changed', 'Innodb_rows_read']: 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__), '../'))) os.path.join(os.path.dirname(__file__), '../')))
parser = argparse.ArgumentParser() parser = argparse.ArgumentParser()
parser.add_argument('-c', '--config', parser.add_argument('-c', '--config',
default= default='/etc/turbo-hipster/config.yaml',
'/etc/turbo-hipster/config.yaml',
help='Path to yaml config file.') help='Path to yaml config file.')
parser.add_argument('-b', '--background', action='store_true', parser.add_argument('-b', '--background', action='store_true',
help='Run as a daemon in the background.') help='Run as a daemon in the background.')

View File

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

View File

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

View File

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