Fix hacking and requirements
Change-Id: Ie7a36b0a7957f102b6a1195cdc7c0403cdd9545a
diff --git a/requirements.txt b/requirements.txt
index 1788b85..ae6769a 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,4 +1,3 @@
-pbr>=0.5.21,<0.6
gear>=0.5.4,<1.0.0
python-swiftclient
python-keystoneclient
diff --git a/setup.cfg b/setup.cfg
index 444a369..51192c4 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -15,10 +15,6 @@
Programming Language :: Python :: 2.7
Programming Language :: Python :: 2.6
-[global]
-setup-hooks =
- pbr.hooks.setup_hook
-
[files]
packages =
turbo_hipster
diff --git a/test-requirements.txt b/test-requirements.txt
index a08c619..1943ed8 100644
--- a/test-requirements.txt
+++ b/test-requirements.txt
@@ -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
diff --git a/tests/disabled_shell_task.py b/tests/disabled_shell_task.py
index 407e335..7bae862 100644
--- a/tests/disabled_shell_task.py
+++ b/tests/disabled_shell_task.py
@@ -136,7 +136,7 @@
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()
diff --git a/turbo_hipster/cmd/analyse_historical.py b/turbo_hipster/cmd/analyse_historical.py
index c76ed4f..a7ce33a 100644
--- a/turbo_hipster/cmd/analyse_historical.py
+++ b/turbo_hipster/cmd/analyse_historical.py
@@ -33,8 +33,7 @@
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 @@
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 @@
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)
diff --git a/turbo_hipster/cmd/report_historical.py b/turbo_hipster/cmd/report_historical.py
index 35f3c9b..50e4a28 100644
--- a/turbo_hipster/cmd/report_historical.py
+++ b/turbo_hipster/cmd/report_historical.py
@@ -116,7 +116,7 @@
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']:
diff --git a/turbo_hipster/cmd/server.py b/turbo_hipster/cmd/server.py
index 30d8aaf..06f9415 100644
--- a/turbo_hipster/cmd/server.py
+++ b/turbo_hipster/cmd/server.py
@@ -65,8 +65,7 @@
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.')
diff --git a/turbo_hipster/lib/models.py b/turbo_hipster/lib/models.py
index 1a2c836..b1cbbd2 100644
--- a/turbo_hipster/lib/models.py
+++ b/turbo_hipster/lib/models.py
@@ -48,7 +48,7 @@
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):
diff --git a/turbo_hipster/task_plugins/real_db_upgrade/handle_results.py b/turbo_hipster/task_plugins/real_db_upgrade/handle_results.py
index 198afe1..e701c5b 100644
--- a/turbo_hipster/task_plugins/real_db_upgrade/handle_results.py
+++ b/turbo_hipster/task_plugins/real_db_upgrade/handle_results.py
@@ -188,7 +188,7 @@
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']))
diff --git a/turbo_hipster/worker_manager.py b/turbo_hipster/worker_manager.py
index 40a1f35..a1cf47b 100644
--- a/turbo_hipster/worker_manager.py
+++ b/turbo_hipster/worker_manager.py
@@ -84,7 +84,7 @@
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 @@
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")