Skip to content

Commit

Permalink
python: Add double newline after fuction or class (E305).
Browse files Browse the repository at this point in the history
pycodestyle >= 2.1.0 reports E305 otherwise, and the flake8-check step
fails.

Signed-off-by: Daniele Di Proietto <[email protected]>
Acked-by: Ben Pfaff <[email protected]>
  • Loading branch information
ddiproietto committed Dec 2, 2016
1 parent 821b866 commit 884e0df
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 0 deletions.
1 change: 1 addition & 0 deletions python/ovs/db/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ def to_json(self):
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)
Expand Down
1 change: 1 addition & 0 deletions python/ovs/fatal_signal.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ def fork():
cancel()

_hooks = []


_added_hook = False
_files = {}
Expand Down
4 changes: 4 additions & 0 deletions python/ovs/stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,8 @@ def _open(suffix, dscp):
connect_path = suffix
return ovs.socket_util.make_unix_socket(socket.SOCK_STREAM,
True, None, connect_path)


Stream.register_method("unix", UnixStream)


Expand All @@ -406,6 +408,8 @@ def _open(suffix, dscp):
if not error:
sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
return error, sock


Stream.register_method("tcp", TCPStream)


Expand Down
1 change: 1 addition & 0 deletions python/ovs/unixctl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
1 change: 1 addition & 0 deletions utilities/checkpatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
20 changes: 20 additions & 0 deletions utilities/ovs-dev.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand All @@ -172,6 +176,8 @@ def check():
flags += "-k %s " % arg
ENV["TESTSUITEFLAGS"] = flags
make("check")


commands.append(check)


Expand All @@ -190,6 +196,8 @@ def tag():
_sh('cscope', '-R', '-b')
except:
pass


commands.append(tag)


Expand All @@ -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)


Expand All @@ -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)


Expand Down Expand Up @@ -285,6 +297,8 @@ def run():
else:
opts = opts + ["-vconsole:off", "--detach", "--enable-dummy"]
_sh(*(cmd + opts))


commands.append(run)


Expand Down Expand Up @@ -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)


Expand Down Expand Up @@ -373,6 +391,8 @@ def doc():
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)


Expand Down

0 comments on commit 884e0df

Please sign in to comment.