diff mbox

[ovs-dev] treewide: Fix recent flake8-check.

Message ID 20161208182216.8018-1-joe@ovn.org
State Accepted
Headers show

Commit Message

Joe Stringer Dec. 8, 2016, 6:22 p.m. UTC
Without this patch, I see errors like this on master:
../ofproto/ipfix-gen-entities:115:1: E305 expected 2 blank lines after
class or function definition, found 1

Signed-off-by: Joe Stringer <joe@ovn.org>
---
 ofproto/ipfix-gen-entities | 1 +
 utilities/ovs-pcap.in      | 3 +++
 utilities/ovs-tcpdump.in   | 1 +
 vtep/ovs-vtep              | 1 +
 4 files changed, 6 insertions(+)

Comments

Daniele Di Proietto Dec. 8, 2016, 7:32 p.m. UTC | #1
2016-12-08 10:22 GMT-08:00 Joe Stringer <joe@ovn.org>:
> Without this patch, I see errors like this on master:
> ../ofproto/ipfix-gen-entities:115:1: E305 expected 2 blank lines after
> class or function definition, found 1
>
> Signed-off-by: Joe Stringer <joe@ovn.org>

Interesting, I pushed a related fix a few days ago, and on my machine
it builds fine even without your patch.

Just curious, which version of pycodestyle do you have?

In any case, I tested it and it builds on my machine

Acked-by: Daniele Di Proietto <diproiettod@vmware.com>

> ---
>  ofproto/ipfix-gen-entities | 1 +
>  utilities/ovs-pcap.in      | 3 +++
>  utilities/ovs-tcpdump.in   | 1 +
>  vtep/ovs-vtep              | 1 +
>  4 files changed, 6 insertions(+)
>
> diff --git a/ofproto/ipfix-gen-entities b/ofproto/ipfix-gen-entities
> index a603cd1d1f2e..0be719967d17 100755
> --- a/ofproto/ipfix-gen-entities
> +++ b/ofproto/ipfix-gen-entities
> @@ -112,6 +112,7 @@ The following options are also available:
>  """ % {'name': name})
>      sys.exit(0)
>
> +
>  if __name__ == '__main__':
>      try:
>          options, args = getopt.gnu_getopt(sys.argv[1:], 'hV',
> diff --git a/utilities/ovs-pcap.in b/utilities/ovs-pcap.in
> index 2e9197d15ffa..c43acb52eae0 100755
> --- a/utilities/ovs-pcap.in
> +++ b/utilities/ovs-pcap.in
> @@ -55,6 +55,8 @@ class PcapReader(object):
>          if len(packet) != incl_len:
>              raise PcapException("end of file reading pcap packet data")
>          return packet
> +
> +
>  argv0 = sys.argv[0]
>
>
> @@ -70,6 +72,7 @@ The following options are also available:
>  """ % {'argv0': argv0})
>      sys.exit(0)
>
> +
>  if __name__ == "__main__":
>      try:
>          try:
> diff --git a/utilities/ovs-tcpdump.in b/utilities/ovs-tcpdump.in
> index 538b3b405c8e..a6e4adadb428 100755
> --- a/utilities/ovs-tcpdump.in
> +++ b/utilities/ovs-tcpdump.in
> @@ -67,6 +67,7 @@ def _install_tap_linux(tap_name):
>          *(['ip', 'link', 'set', 'dev', str(tap_name), 'up']))
>      pipe.wait()
>
> +
>  _make_taps['linux'] = _install_tap_linux
>  _make_taps['linux2'] = _install_tap_linux
>
> diff --git a/vtep/ovs-vtep b/vtep/ovs-vtep
> index b32a82a907ea..9a5aa3d680bb 100755
> --- a/vtep/ovs-vtep
> +++ b/vtep/ovs-vtep
> @@ -752,6 +752,7 @@ def main():
>
>      unixctl.close()
>
> +
>  if __name__ == '__main__':
>      try:
>          main()
> --
> 2.10.2
>
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Joe Stringer Dec. 8, 2016, 10:03 p.m. UTC | #2
On 8 December 2016 at 11:32, Daniele Di Proietto <diproiettod@ovn.org> wrote:
> 2016-12-08 10:22 GMT-08:00 Joe Stringer <joe@ovn.org>:
>> Without this patch, I see errors like this on master:
>> ../ofproto/ipfix-gen-entities:115:1: E305 expected 2 blank lines after
>> class or function definition, found 1
>>
>> Signed-off-by: Joe Stringer <joe@ovn.org>
>
> Interesting, I pushed a related fix a few days ago, and on my machine
> it builds fine even without your patch.
>
> Just curious, which version of pycodestyle do you have?

$ pycodestyle --version
2.2.0
$ python --version
Python 3.5.2

> In any case, I tested it and it builds on my machine
>
> Acked-by: Daniele Di Proietto <diproiettod@vmware.com>

Thanks, applied.
diff mbox

Patch

diff --git a/ofproto/ipfix-gen-entities b/ofproto/ipfix-gen-entities
index a603cd1d1f2e..0be719967d17 100755
--- a/ofproto/ipfix-gen-entities
+++ b/ofproto/ipfix-gen-entities
@@ -112,6 +112,7 @@  The following options are also available:
 """ % {'name': name})
     sys.exit(0)
 
+
 if __name__ == '__main__':
     try:
         options, args = getopt.gnu_getopt(sys.argv[1:], 'hV',
diff --git a/utilities/ovs-pcap.in b/utilities/ovs-pcap.in
index 2e9197d15ffa..c43acb52eae0 100755
--- a/utilities/ovs-pcap.in
+++ b/utilities/ovs-pcap.in
@@ -55,6 +55,8 @@  class PcapReader(object):
         if len(packet) != incl_len:
             raise PcapException("end of file reading pcap packet data")
         return packet
+
+
 argv0 = sys.argv[0]
 
 
@@ -70,6 +72,7 @@  The following options are also available:
 """ % {'argv0': argv0})
     sys.exit(0)
 
+
 if __name__ == "__main__":
     try:
         try:
diff --git a/utilities/ovs-tcpdump.in b/utilities/ovs-tcpdump.in
index 538b3b405c8e..a6e4adadb428 100755
--- a/utilities/ovs-tcpdump.in
+++ b/utilities/ovs-tcpdump.in
@@ -67,6 +67,7 @@  def _install_tap_linux(tap_name):
         *(['ip', 'link', 'set', 'dev', str(tap_name), 'up']))
     pipe.wait()
 
+
 _make_taps['linux'] = _install_tap_linux
 _make_taps['linux2'] = _install_tap_linux
 
diff --git a/vtep/ovs-vtep b/vtep/ovs-vtep
index b32a82a907ea..9a5aa3d680bb 100755
--- a/vtep/ovs-vtep
+++ b/vtep/ovs-vtep
@@ -752,6 +752,7 @@  def main():
 
     unixctl.close()
 
+
 if __name__ == '__main__':
     try:
         main()