mirror of
https://github.com/openvswitch/ovs
synced 2025-10-23 14:57:06 +00:00
python: Add double newline after fuction or class (E305).
pycodestyle >= 2.1.0 reports E305 otherwise, and the flake8-check step fails. Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com> Acked-by: Ben Pfaff <blp@ovn.org>
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -43,6 +43,7 @@ def fork():
|
||||
cancel()
|
||||
|
||||
_hooks = []
|
||||
|
||||
|
||||
_added_hook = False
|
||||
_files = {}
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user