From 2523637243a1c5978e5115531d1d636bf6fc860c Mon Sep 17 00:00:00 2001 From: Davanum Srinivas Date: Tue, 12 Jan 2016 17:10:30 -0500 Subject: [PATCH] Fix pep8 errors "tox -e pep8" is showing these new errors ./openstack_releases/gitutils.py:52:9: W503 line break before binary operator ./openstack_releases/governance.py:77:21: W503 line break before binary operator ./openstack_releases/cmds/list_changes.py:152:21: W503 line break before binary operator ./openstack_releases/cmds/validate.py:36:1: E402 module level import not at top of file ./openstack_releases/cmds/validate.py:37:1: E402 module level import not at top of file ./openstack_releases/cmds/validate.py:38:1: E402 module level import not at top of file Change-Id: I4c460928af038fc93ca1057953408f8cc7cac24e --- openstack_releases/cmds/list_changes.py | 4 +--- openstack_releases/cmds/validate.py | 3 ++- openstack_releases/gitutils.py | 3 +-- openstack_releases/governance.py | 4 ++-- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/openstack_releases/cmds/list_changes.py b/openstack_releases/cmds/list_changes.py index 0099269c01..b55f3a7acd 100644 --- a/openstack_releases/cmds/list_changes.py +++ b/openstack_releases/cmds/list_changes.py @@ -148,9 +148,7 @@ def main(): start_range = previous_project['hash'] if not start_range: start_range = ( - gitutils.get_latest_tag(workdir, project['repo']) - or - None + gitutils.get_latest_tag(workdir, project['repo']) or None ) if start_range: diff --git a/openstack_releases/cmds/validate.py b/openstack_releases/cmds/validate.py index fd371b9e30..01165c5c76 100755 --- a/openstack_releases/cmds/validate.py +++ b/openstack_releases/cmds/validate.py @@ -31,12 +31,13 @@ import yaml # Disable warnings about insecure connections. from requests.packages import urllib3 -urllib3.disable_warnings() from openstack_releases import defaults from openstack_releases import gitutils from openstack_releases import versionutils +urllib3.disable_warnings() + def is_a_hash(val): "Return bool indicating if val looks like a valid hash." diff --git a/openstack_releases/gitutils.py b/openstack_releases/gitutils.py index 3091dbdcd2..3d1cd63f92 100644 --- a/openstack_releases/gitutils.py +++ b/openstack_releases/gitutils.py @@ -48,8 +48,7 @@ def commit_exists(repo, ref): url = CGIT_TEMPLATE % (repo, ref) response = requests.get(url) missing_commit = ( - (response.status_code // 100 != 2) - or 'Bad object id' in response.text + (response.status_code // 100 != 2) or 'Bad object id' in response.text ) return not missing_commit diff --git a/openstack_releases/governance.py b/openstack_releases/governance.py index a8b20e4e64..e6d508d0ed 100644 --- a/openstack_releases/governance.py +++ b/openstack_releases/governance.py @@ -73,5 +73,5 @@ class Repository(object): @property def code_related(self): - return not (self.name.endswith('-specs') - or 'cookiecutter' in self.name) + return (not (self.name.endswith('-specs') or + 'cookiecutter' in self.name))