From patchwork Mon Dec 21 20:47:06 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Russell Bryant X-Patchwork-Id: 559702 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from archives.nicira.com (unknown [IPv6:2600:3c00::f03c:91ff:fe6e:bdf7]) by ozlabs.org (Postfix) with ESMTP id 12E0B140BA1 for ; Tue, 22 Dec 2015 07:49:05 +1100 (AEDT) Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id 562CC1062D; Mon, 21 Dec 2015 12:48:12 -0800 (PST) X-Original-To: dev@openvswitch.org Delivered-To: dev@openvswitch.org Received: from mx1e4.cudamail.com (mx1.cudamail.com [69.90.118.67]) by archives.nicira.com (Postfix) with ESMTPS id 35C1910615 for ; Mon, 21 Dec 2015 12:48:11 -0800 (PST) Received: from bar2.cudamail.com (unknown [192.168.21.12]) by mx1e4.cudamail.com (Postfix) with ESMTPS id 9EA4B1E00DA for ; Mon, 21 Dec 2015 13:48:10 -0700 (MST) X-ASG-Debug-ID: 1450730890-03dc53742209cd0001-byXFYA Received: from mx1-pf1.cudamail.com ([192.168.24.1]) by bar2.cudamail.com with ESMTP id DkArYFLCErfusIUD (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 21 Dec 2015 13:48:10 -0700 (MST) X-Barracuda-Envelope-From: russell@ovn.org X-Barracuda-RBL-Trusted-Forwarder: 192.168.24.1 Received: from unknown (HELO mx1.redhat.com) (209.132.183.28) by mx1-pf1.cudamail.com with ESMTPS (DHE-RSA-AES256-SHA encrypted); 21 Dec 2015 20:48:09 -0000 Received-SPF: neutral (mx1-pf1.cudamail.com: 209.132.183.28 is neither permitted nor denied by SPF record at ovn.org) X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-Barracuda-RBL-IP: 209.132.183.28 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id 0E5ED264F; Mon, 21 Dec 2015 20:48:09 +0000 (UTC) Received: from x1c.redhat.com ([10.3.112.11]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id tBLKm0dT002018; Mon, 21 Dec 2015 15:48:08 -0500 X-CudaMail-Envelope-Sender: russell@ovn.org From: Russell Bryant To: dev@openvswitch.org X-CudaMail-Whitelist-To: dev@openvswitch.org X-CudaMail-MID: CM-E1-1220081307 X-CudaMail-DTE: 122115 X-CudaMail-Originating-IP: 209.132.183.28 Date: Mon, 21 Dec 2015 15:47:06 -0500 X-ASG-Orig-Subj: [##CM-E1-1220081307##][PATCH 06/55] python: Resolve pep8 blank line errors. Message-Id: <1450730875-18083-7-git-send-email-russell@ovn.org> In-Reply-To: <1450730875-18083-1-git-send-email-russell@ovn.org> References: <1450730875-18083-1-git-send-email-russell@ovn.org> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Barracuda-Connect: UNKNOWN[192.168.24.1] X-Barracuda-Start-Time: 1450730890 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://web.cudamail.com:443/cgi-mod/mark.cgi X-ASG-Whitelist: Header =?UTF-8?B?eFwtY3VkYW1haWxcLXdoaXRlbGlzdFwtdG8=?= X-Virus-Scanned: by bsmtpd at cudamail.com X-Barracuda-BRTS-Status: 1 Subject: [ovs-dev] [PATCH 06/55] python: Resolve pep8 blank line errors. X-BeenThere: dev@openvswitch.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dev-bounces@openvswitch.org Sender: "dev" Resolve pep8 errors E302 and E303: E302 expected 2 blank lines, found 1 E303 too many blank lines (3) Signed-off-by: Russell Bryant --- python/ovs/poller.py | 1 + python/ovs/timeval.py | 3 +++ python/ovs/unixctl/__init__.py | 1 + python/ovs/unixctl/server.py | 1 + python/ovstest/args.py | 2 ++ python/ovstest/tests.py | 1 - python/ovstest/vswitch.py | 1 + python/tox.ini | 2 +- 8 files changed, 10 insertions(+), 2 deletions(-) diff --git a/python/ovs/poller.py b/python/ovs/poller.py index d07033b..76234dc 100644 --- a/python/ovs/poller.py +++ b/python/ovs/poller.py @@ -35,6 +35,7 @@ POLLERR = 0x008 POLLHUP = 0x010 POLLNVAL = 0x020 + # eventlet/gevent doesn't support select.poll. If select.poll is used, # python interpreter is blocked as a whole instead of switching from the # current thread that is about to block to other runnable thread. diff --git a/python/ovs/timeval.py b/python/ovs/timeval.py index a16bf60..9a0cf67 100644 --- a/python/ovs/timeval.py +++ b/python/ovs/timeval.py @@ -52,6 +52,7 @@ except: # Librt shared library could not be loaded librt = None + def monotonic(): if not librt: return time.time() @@ -62,10 +63,12 @@ def monotonic(): # Kernel does not support CLOCK_MONOTONIC return time.time() + # Use time.monotonic() if Python version >= 3.3 if not hasattr(time, 'monotonic'): time.monotonic = monotonic + def msec(): """ Returns the system's monotonic time if possible, otherwise returns the current time as the amount of time since the epoch, in milliseconds, as a diff --git a/python/ovs/unixctl/__init__.py b/python/ovs/unixctl/__init__.py index 715f2db..c6484c4 100644 --- a/python/ovs/unixctl/__init__.py +++ b/python/ovs/unixctl/__init__.py @@ -67,6 +67,7 @@ def command_register(name, usage, min_args, max_args, callback, aux): commands[name] = _UnixctlCommand(usage, min_args, max_args, callback, aux) + def socket_name_from_target(target): assert isinstance(target, strtypes) diff --git a/python/ovs/unixctl/server.py b/python/ovs/unixctl/server.py index 18e1cf2..c750fe9 100644 --- a/python/ovs/unixctl/server.py +++ b/python/ovs/unixctl/server.py @@ -135,6 +135,7 @@ def _unixctl_version(conn, unused_argv, version): version = "%s (Open vSwitch) %s" % (ovs.util.PROGRAM_NAME, version) conn.reply(version) + class UnixctlServer(object): def __init__(self, listener): assert isinstance(listener, ovs.stream.PassiveStream) diff --git a/python/ovstest/args.py b/python/ovstest/args.py index e90db2a..4344979 100644 --- a/python/ovstest/args.py +++ b/python/ovstest/args.py @@ -24,6 +24,7 @@ import sys CONTROL_PORT = 15531 DATA_PORT = 15532 + def ip_address(string): """Verifies if string is a valid IP address""" try: @@ -246,6 +247,7 @@ def ovs_initialize_args(): 'OuterIP.') return parser.parse_args() + def l3_initialize_args(): """ Initialize argument parsing for ovs-l3ping utility. diff --git a/python/ovstest/tests.py b/python/ovstest/tests.py index 5d5a85f..26befef 100644 --- a/python/ovstest/tests.py +++ b/python/ovstest/tests.py @@ -139,7 +139,6 @@ def do_l3_tests(node1, node2, bandwidth, duration, ps, type): server.del_bridge(DEFAULT_TEST_BRIDGE) - def do_vlan_tests(node1, node2, bandwidth, duration, ps, tag): """ Do VLAN tests between node1 and node2. Each node is given diff --git a/python/ovstest/vswitch.py b/python/ovstest/vswitch.py index be66a2e..1c6726e 100644 --- a/python/ovstest/vswitch.py +++ b/python/ovstest/vswitch.py @@ -33,6 +33,7 @@ def ovs_vsctl_del_bridge(bridge): ret, _out, _err = util.start_process(["ovs-vsctl", "del-br", bridge]) return ret + def ovs_vsctl_del_pbridge(bridge, iface): """ This function deletes the OVS bridge and assigns the bridge IP address diff --git a/python/tox.ini b/python/tox.ini index 9f5947b..44bafd3 100644 --- a/python/tox.ini +++ b/python/tox.ini @@ -16,5 +16,5 @@ deps = -r{toxinidir}/requirements.txt commands = flake8 [flake8] -ignore=E111,E113,E126,E127,E128,E129,E131,E201,E203,E226,E231,E241,E251,E261,E262,E265,E271,E302,E303,E501,E711,E721 +ignore=E111,E113,E126,E127,E128,E129,E131,E201,E203,E226,E231,E241,E251,E261,E262,E265,E271,E501,E711,E721 exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build