From f9171339ff51b4c2149c76b8bc7d32c38e4afc70 Mon Sep 17 00:00:00 2001 From: "zhu.rong" Date: Fri, 25 Sep 2015 13:30:11 +0800 Subject: [PATCH] Fix the run_test unchecked pep8 W503 errors Now thw flake8 did not check W503 error, W503:doesn't allow binary ops at start of line, And this patch fixes it. Change-Id: I7b2cccee662bbabac381e82cad221803618f3065 --- muranodashboard/api/rest/packages.py | 2 -- muranodashboard/common/net.py | 4 ++-- muranodashboard/environments/tables.py | 14 +++++++------- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/muranodashboard/api/rest/packages.py b/muranodashboard/api/rest/packages.py index 00039337a..e6d8c34f0 100644 --- a/muranodashboard/api/rest/packages.py +++ b/muranodashboard/api/rest/packages.py @@ -63,5 +63,3 @@ class Packages(generic.View): 'packages': [p.to_dict() for p in packages], 'has_more_data': has_more_data, } - - diff --git a/muranodashboard/common/net.py b/muranodashboard/common/net.py index 3dcb3cf41..199a7fb83 100644 --- a/muranodashboard/common/net.py +++ b/muranodashboard/common/net.py @@ -82,8 +82,8 @@ def get_available_networks(request, include_subnets=True, cidr=subnet.cidr, subnet=subnet.name_or_id)) - network_choices.append(((net.id, subnet.id), netname - or full_name)) + network_choices.append( + ((net.id, subnet.id), netname or full_name)) else: netname = netname or net.name_or_id diff --git a/muranodashboard/environments/tables.py b/muranodashboard/environments/tables.py index 56b2d5d48..e0800f8da 100644 --- a/muranodashboard/environments/tables.py +++ b/muranodashboard/environments/tables.py @@ -183,11 +183,11 @@ class DeployEnvironment(tables.BatchAction): or successful deploy or delete failure) """ status = getattr(environment, 'status', None) - if (status != consts.STATUS_ID_DEPLOY_FAILURE - and not environment.has_new_services): - return False - if (status in consts.NO_ACTION_ALLOWED_STATUSES - or status == consts.STATUS_ID_READY): + if (status != consts.STATUS_ID_DEPLOY_FAILURE and + not environment.has_new_services): + return False + if (status in consts.NO_ACTION_ALLOWED_STATUSES or + status == consts.STATUS_ID_READY): return False return True @@ -217,8 +217,8 @@ class DeployThisEnvironment(tables.Action): """ status, version = _get_environment_status_and_version(request, self.table) - if (status in consts.NO_ACTION_ALLOWED_STATUSES - or status == consts.STATUS_ID_READY): + if (status in consts.NO_ACTION_ALLOWED_STATUSES or + status == consts.STATUS_ID_READY): return False apps = self.table.data