pycodestyle >= 2.1.0 reports E305 otherwise, and the flake8-check step fails.
Signed-off-by: Daniele Di Proietto <[email protected]> --- python/ovs/db/types.py | 1 + python/ovs/fatal_signal.py | 1 + python/ovs/stream.py | 4 ++++ python/ovs/unixctl/__init__.py | 1 + utilities/checkpatch.py | 1 + utilities/ovs-dev.py | 20 ++++++++++++++++++++ 6 files changed, 28 insertions(+) diff --git a/python/ovs/db/types.py b/python/ovs/db/types.py index 2d2ef8f..78d5fcd 100644 --- a/python/ovs/db/types.py +++ b/python/ovs/db/types.py @@ -56,6 +56,7 @@ class AtomicType(object): def default_atom(self): return ovs.db.data.Atom(self, self.default) + REAL_PYTHON_TYPES = list(six.integer_types) REAL_PYTHON_TYPES.extend([float]) REAL_PYTHON_TYPES = tuple(REAL_PYTHON_TYPES) diff --git a/python/ovs/fatal_signal.py b/python/ovs/fatal_signal.py index 73e4be6..a143e24 100644 --- a/python/ovs/fatal_signal.py +++ b/python/ovs/fatal_signal.py @@ -43,6 +43,7 @@ def fork(): cancel() _hooks = [] + _added_hook = False _files = {} diff --git a/python/ovs/stream.py b/python/ovs/stream.py index 59578b1..b43e105 100644 --- a/python/ovs/stream.py +++ b/python/ovs/stream.py @@ -395,6 +395,8 @@ class UnixStream(Stream): connect_path = suffix return ovs.socket_util.make_unix_socket(socket.SOCK_STREAM, True, None, connect_path) + + Stream.register_method("unix", UnixStream) @@ -406,6 +408,8 @@ class TCPStream(Stream): if not error: sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1) return error, sock + + Stream.register_method("tcp", TCPStream) diff --git a/python/ovs/unixctl/__init__.py b/python/ovs/unixctl/__init__.py index 48b56d4..a2b13f9 100644 --- a/python/ovs/unixctl/__init__.py +++ b/python/ovs/unixctl/__init__.py @@ -86,4 +86,5 @@ def socket_name_from_target(target): else: return 0, "%s/%s.%d.ctl" % (ovs.dirs.RUNDIR, target, pid) + command_register("help", "", 0, 0, _unixctl_help, None) diff --git a/utilities/checkpatch.py b/utilities/checkpatch.py index 5e6e83d..26eb5c3 100755 --- a/utilities/checkpatch.py +++ b/utilities/checkpatch.py @@ -298,6 +298,7 @@ def ovs_checkpatch_file(filename): print("Warnings: %d, Errors: %d" % (__warnings, __errors)) return result + if __name__ == '__main__': try: optlist, args = getopt.getopt(sys.argv[1:], 'bhlstf', diff --git a/utilities/ovs-dev.py b/utilities/ovs-dev.py index 9188d73..6a626a1 100755 --- a/utilities/ovs-dev.py +++ b/utilities/ovs-dev.py @@ -149,12 +149,16 @@ def conf(): mf.write("\ncheck:\n") mf.write(make_str % BUILD_GCC) mf.close() + + commands.append(conf) def make(args=""): make = "make -s -j 8 " + args _sh(make) + + commands.append(make) @@ -172,6 +176,8 @@ def check(): flags += "-k %s " % arg ENV["TESTSUITEFLAGS"] = flags make("check") + + commands.append(check) @@ -190,6 +196,8 @@ def tag(): _sh('cscope', '-R', '-b') except: pass + + commands.append(tag) @@ -200,6 +208,8 @@ def kill(): _sh("ovs-appctl", "-t", proc, "exit", check=False) time.sleep(.1) _sh("killall", "-q", "-2", proc, check=False) + + commands.append(kill) @@ -210,6 +220,8 @@ def reset(): shutil.rmtree(RUNDIR) for dp in _sh("ovs-dpctl dump-dps", capture=True): _sh("ovs-dpctl", "del-dp", dp.decode().strip()) + + commands.append(reset) @@ -285,6 +297,8 @@ def run(): else: opts = opts + ["-vconsole:off", "--detach", "--enable-dummy"] _sh(*(cmd + opts)) + + commands.append(run) @@ -313,11 +327,15 @@ def modinst(): _sh("dmesg | grep openvswitch | tail -1") _sh("find /lib/modules/%s/ -iname vport-*.ko -exec insmod '{}' \;" % uname()) + + commands.append(modinst) def env(): print("export PATH=" + ENV["PATH"]) + + commands.append(env) @@ -373,6 +391,8 @@ Note: will always run as the root user, by rerun the commands with "sudo". """ % {"ovs": OVS_SRC, "v": sys.argv[0], "run": RUNDIR}) sys.exit(0) + + commands.append(doc) -- 2.10.2 _______________________________________________ dev mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-dev
