<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/openvswitch.git/python, branch branch-2.2</title>
<subtitle>github.com: openvswitch/ovs.git
</subtitle>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/openvswitch.git/'/>
<entry>
<title>python: Escape backslashes while formatting logs.</title>
<updated>2019-01-15T17:13:20+00:00</updated>
<author>
<name>Ilya Maximets</name>
<email>i.maximets@samsung.com</email>
</author>
<published>2019-01-15T14:03:00+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/openvswitch.git/commit/?id=35f095fbdc183e13419a318b0fe17b332d3c68ab'/>
<id>35f095fbdc183e13419a318b0fe17b332d3c68ab</id>
<content type='text'>
Since python version 3.7 (and some 3.6+ versions) regexp engine
changed to treat the wrong escape sequences as errors. Previously,
if the replace string had something like '\u0000', '\u' was
qualified as a bad escape sequence and treated just as a sequence
of characters '\' and 'u'. But know this triggers an error:

  Traceback (most recent call last):
    File "/usr/lib/python3.7/sre_parse.py", line 1021, in parse_template
      this = chr(ESCAPES[this][1])
  KeyError: '\\u'

From the documentation [1]:

  Unknown escapes consisting of '\' and an ASCII letter in replacement
  templates for re.sub() were deprecated in Python 3.5, and will now
  cause an error.

[1] https://docs.python.org/3/whatsnew/3.7.html#api-and-feature-removals

We need to escape the backslash by another one to keep regexp engine
from errors. In case of '\\u000', '\\' is a valid escape sequence
and the 'u' is a simple character.

To be 100% safe we need to use 're.escape(replace)', but it escapes
too many characters making the logs hard to read.

This change fixes Python 3 tests on systems with python 3.7.
Should be backward compatible.

Reported-by: Ben Pfaff &lt;blp@ovn.org&gt;
Signed-off-by: Ilya Maximets &lt;i.maximets@samsung.com&gt;
Signed-off-by: Ben Pfaff &lt;blp@ovn.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Since python version 3.7 (and some 3.6+ versions) regexp engine
changed to treat the wrong escape sequences as errors. Previously,
if the replace string had something like '\u0000', '\u' was
qualified as a bad escape sequence and treated just as a sequence
of characters '\' and 'u'. But know this triggers an error:

  Traceback (most recent call last):
    File "/usr/lib/python3.7/sre_parse.py", line 1021, in parse_template
      this = chr(ESCAPES[this][1])
  KeyError: '\\u'

From the documentation [1]:

  Unknown escapes consisting of '\' and an ASCII letter in replacement
  templates for re.sub() were deprecated in Python 3.5, and will now
  cause an error.

[1] https://docs.python.org/3/whatsnew/3.7.html#api-and-feature-removals

We need to escape the backslash by another one to keep regexp engine
from errors. In case of '\\u000', '\\' is a valid escape sequence
and the 'u' is a simple character.

To be 100% safe we need to use 're.escape(replace)', but it escapes
too many characters making the logs hard to read.

This change fixes Python 3 tests on systems with python 3.7.
Should be backward compatible.

Reported-by: Ben Pfaff &lt;blp@ovn.org&gt;
Signed-off-by: Ilya Maximets &lt;i.maximets@samsung.com&gt;
Signed-off-by: Ben Pfaff &lt;blp@ovn.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>python: Catch setsockopt exceptions for TCP stream.</title>
<updated>2018-12-20T18:12:41+00:00</updated>
<author>
<name>Ilya Maximets</name>
<email>i.maximets@samsung.com</email>
</author>
<published>2018-12-20T17:35:57+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/openvswitch.git/commit/?id=5e8f1b15910ebbbcffe98992e1b08d797f483bee'/>
<id>5e8f1b15910ebbbcffe98992e1b08d797f483bee</id>
<content type='text'>
'sock.setsockopt' could throw exceptions. For example, if non-blocking
connection failed before the call:

  Traceback (most recent call last):
    File "../.././test-ovsdb.py", line 896, in &lt;module&gt;
      main(sys.argv)
    File "../.././test-ovsdb.py", line 891, in main
      func(*args)
    File "../.././test-ovsdb.py", line 604, in do_idl
      ovs.stream.Stream.open(r))
    File "/root/git_/ovs/python/ovs/stream.py", line 190, in open
      error, sock = cls._open(suffix, dscp)
    File "/root/git_/ovs/python/ovs/stream.py", line 744, in _open
      sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
    File "/usr/local/lib/python2.7/socket.py", line 228, in meth
      return getattr(self._sock,name)(*args)
  socket.error: [Errno 54] Connection reset by peer

This fixes tests on FreeBSD.

Signed-off-by: Ilya Maximets &lt;i.maximets@samsung.com&gt;
Signed-off-by: Ben Pfaff &lt;blp@ovn.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
'sock.setsockopt' could throw exceptions. For example, if non-blocking
connection failed before the call:

  Traceback (most recent call last):
    File "../.././test-ovsdb.py", line 896, in &lt;module&gt;
      main(sys.argv)
    File "../.././test-ovsdb.py", line 891, in main
      func(*args)
    File "../.././test-ovsdb.py", line 604, in do_idl
      ovs.stream.Stream.open(r))
    File "/root/git_/ovs/python/ovs/stream.py", line 190, in open
      error, sock = cls._open(suffix, dscp)
    File "/root/git_/ovs/python/ovs/stream.py", line 744, in _open
      sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
    File "/usr/local/lib/python2.7/socket.py", line 228, in meth
      return getattr(self._sock,name)(*args)
  socket.error: [Errno 54] Connection reset by peer

This fixes tests on FreeBSD.

Signed-off-by: Ilya Maximets &lt;i.maximets@samsung.com&gt;
Signed-off-by: Ben Pfaff &lt;blp@ovn.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>vlog: Use python 2.4 compatible functions.</title>
<updated>2014-05-05T21:20:08+00:00</updated>
<author>
<name>Gurucharan Shetty</name>
<email>gshetty@nicira.com</email>
</author>
<published>2014-05-05T19:30:48+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/openvswitch.git/commit/?id=28b979960bd851f3927011db1959677215e96176'/>
<id>28b979960bd851f3927011db1959677215e96176</id>
<content type='text'>
Xenserver uses python 2.4.

Signed-off-by: Gurucharan Shetty &lt;gshetty@nicira.com&gt;
Acked-by: Ben Pfaff &lt;blp@nicira.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Xenserver uses python 2.4.

Signed-off-by: Gurucharan Shetty &lt;gshetty@nicira.com&gt;
Acked-by: Ben Pfaff &lt;blp@nicira.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Python Logging Formatting Improvements</title>
<updated>2014-04-28T16:09:04+00:00</updated>
<author>
<name>Dave Tucker</name>
<email>dave@dtucker.co.uk</email>
</author>
<published>2014-03-30T11:26:55+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/openvswitch.git/commit/?id=a5ed8fe32cb3c996837c61af2e358fa34dc9936f'/>
<id>a5ed8fe32cb3c996837c61af2e358fa34dc9936f</id>
<content type='text'>
The Open vSwitch daemons written in C support user-configured logging
patterns as described in ovs-appctl(8). This commit adds this capability
to the daemons written in Python.

- Add a '__log_patterns' attribute to the Vlog class
- Populate this using the default patterns in ovs-appctl(8)
- Add a '__start_time' attribute to the Vlog class to support '%r'
- Update the '_log' method to build the log message according to the
  pattern
- Add a 'set_pattern' method to allow the default patterns to be changed
- Update 'set_levels_from_string' to support setting the pattern from a
  string

Signed-off-by: Dave Tucker &lt;dave@dtucker.co.uk&gt;
Signed-off-by: Ben Pfaff &lt;blp@nicira.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The Open vSwitch daemons written in C support user-configured logging
patterns as described in ovs-appctl(8). This commit adds this capability
to the daemons written in Python.

- Add a '__log_patterns' attribute to the Vlog class
- Populate this using the default patterns in ovs-appctl(8)
- Add a '__start_time' attribute to the Vlog class to support '%r'
- Update the '_log' method to build the log message according to the
  pattern
- Add a 'set_pattern' method to allow the default patterns to be changed
- Update 'set_levels_from_string' to support setting the pattern from a
  string

Signed-off-by: Dave Tucker &lt;dave@dtucker.co.uk&gt;
Signed-off-by: Ben Pfaff &lt;blp@nicira.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ovsdb: Remove SPECS in favor of referring to RFC 7047.</title>
<updated>2014-04-04T20:51:32+00:00</updated>
<author>
<name>Ben Pfaff</name>
<email>blp@nicira.com</email>
</author>
<published>2014-04-04T16:43:54+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/openvswitch.git/commit/?id=c70a77673cfc9e70d4e7e1633bdfa461fbd154f3'/>
<id>c70a77673cfc9e70d4e7e1633bdfa461fbd154f3</id>
<content type='text'>
Also, add some clarifications relative to RFC 7047 to ovsdb-server(1).

Signed-off-by: Ben Pfaff &lt;blp@nicira.com&gt;
Acked-by: Justin Pettit &lt;jpettit@nicira.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Also, add some clarifications relative to RFC 7047 to ovsdb-server(1).

Signed-off-by: Ben Pfaff &lt;blp@nicira.com&gt;
Acked-by: Justin Pettit &lt;jpettit@nicira.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>socket-util: Fix set_dscp for IPv6</title>
<updated>2014-02-26T16:18:03+00:00</updated>
<author>
<name>YAMAMOTO Takashi</name>
<email>yamamoto@valinux.co.jp</email>
</author>
<published>2014-02-24T02:46:59+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/openvswitch.git/commit/?id=92ae5930c220d5994b691346526bde548ea97765'/>
<id>92ae5930c220d5994b691346526bde548ea97765</id>
<content type='text'>
Try IPPROTO_IPV6/IPV6_TCLASS socket option as well as IPPROTO_IP/IP_TOS
so that this can work for IPv6 sockets.

IPPROTO_IP/IP_TOS socket option is, as it's SOL indicates, for IPv4.
What happens when it's used for IPv6 sockets?  On Linux, it seems to
be forwarded to IPv4 code and affects IPv4 part of the socket.
(e.g. non-V6ONLY case)  But it doesn't seem to be the intention of
this function.  On other platforms including NetBSD, it just fails
with ENOPROTOOPT.

Probably this function should take the address family but passing
it around lib/*stream*.c would be a bigger change.

Cc: Arun Sharma &lt;arun.sharma@calsoftinc.com&gt;
Signed-off-by: YAMAMOTO Takashi &lt;yamamoto@valinux.co.jp&gt;
Signed-off-by: Ben Pfaff &lt;blp@nicira.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Try IPPROTO_IPV6/IPV6_TCLASS socket option as well as IPPROTO_IP/IP_TOS
so that this can work for IPv6 sockets.

IPPROTO_IP/IP_TOS socket option is, as it's SOL indicates, for IPv4.
What happens when it's used for IPv6 sockets?  On Linux, it seems to
be forwarded to IPv4 code and affects IPv4 part of the socket.
(e.g. non-V6ONLY case)  But it doesn't seem to be the intention of
this function.  On other platforms including NetBSD, it just fails
with ENOPROTOOPT.

Probably this function should take the address family but passing
it around lib/*stream*.c would be a bigger change.

Cc: Arun Sharma &lt;arun.sharma@calsoftinc.com&gt;
Signed-off-by: YAMAMOTO Takashi &lt;yamamoto@valinux.co.jp&gt;
Signed-off-by: Ben Pfaff &lt;blp@nicira.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Add IPv6 support for OpenFlow, OVSDB, NetFlow, and sFlow.</title>
<updated>2014-02-07T00:08:34+00:00</updated>
<author>
<name>Arun Sharma</name>
<email>arun.sharma@calsoftinc.com</email>
</author>
<published>2014-02-07T00:04:05+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/openvswitch.git/commit/?id=e731d71bf47b8370e4bfa87827113eedd20b7398'/>
<id>e731d71bf47b8370e4bfa87827113eedd20b7398</id>
<content type='text'>
Does not add IPv6 support for in-band control.

Co-authored-by: Ben Pfaff &lt;blp@nicira.com&gt;
Signed-off-by: Nandan Nivgune &lt;nandan.nivgune@calsoftinc.com&gt;
Signed-off-by: Abhijit Bhopatkar &lt;abhijit.bhopatkar@calsoftinc.com&gt;
Signed-off-by: Arun Sharma &lt;arun.sharma@calsoftinc.com&gt;
Signed-off-by: Ben Pfaff &lt;blp@nicira.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Does not add IPv6 support for in-band control.

Co-authored-by: Ben Pfaff &lt;blp@nicira.com&gt;
Signed-off-by: Nandan Nivgune &lt;nandan.nivgune@calsoftinc.com&gt;
Signed-off-by: Abhijit Bhopatkar &lt;abhijit.bhopatkar@calsoftinc.com&gt;
Signed-off-by: Arun Sharma &lt;arun.sharma@calsoftinc.com&gt;
Signed-off-by: Ben Pfaff &lt;blp@nicira.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>daemon: Cleanup some functions.</title>
<updated>2014-01-24T16:32:23+00:00</updated>
<author>
<name>Gurucharan Shetty</name>
<email>gshetty@nicira.com</email>
</author>
<published>2014-01-10T16:33:15+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/openvswitch.git/commit/?id=d6056bc7ce15e7b4d1950fda5ad0ee4df7d6a04b'/>
<id>d6056bc7ce15e7b4d1950fda5ad0ee4df7d6a04b</id>
<content type='text'>
Some functions are unused and some functions can be
declared as static.

Signed-off-by: Gurucharan Shetty &lt;gshetty@nicira.com&gt;
Acked-by: Ben Pfaff &lt;blp@nicira.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Some functions are unused and some functions can be
declared as static.

Signed-off-by: Gurucharan Shetty &lt;gshetty@nicira.com&gt;
Acked-by: Ben Pfaff &lt;blp@nicira.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>jsonrpc: Only compose message to log if it's really going to be logged.</title>
<updated>2013-10-25T18:24:16+00:00</updated>
<author>
<name>Ben Pfaff</name>
<email>blp@nicira.com</email>
</author>
<published>2013-10-25T16:22:37+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/openvswitch.git/commit/?id=03922c9091330d93d699247bd6e5f4a8491d640b'/>
<id>03922c9091330d93d699247bd6e5f4a8491d640b</id>
<content type='text'>
This suppresses a testsuite failure when the testsuite is run from a
directory whose name contains a non-ASCII character.  I'd rather fix the
problem but webpages like the following make it sound difficult or
impossible on Python 2.x: http://stackoverflow.com/a/11742928

Signed-off-by: Ben Pfaff &lt;blp@nicira.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This suppresses a testsuite failure when the testsuite is run from a
directory whose name contains a non-ASCII character.  I'd rather fix the
problem but webpages like the following make it sound difficult or
impossible on Python 2.x: http://stackoverflow.com/a/11742928

Signed-off-by: Ben Pfaff &lt;blp@nicira.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>socket-util: Add symlink based workaround for long pathnames.</title>
<updated>2013-10-18T04:13:40+00:00</updated>
<author>
<name>YAMAMOTO Takashi</name>
<email>yamamoto@valinux.co.jp</email>
</author>
<published>2013-10-17T16:47:57+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/openvswitch.git/commit/?id=5b5d1836ddfa1a83a9d3369c119eb4716831b8dd'/>
<id>5b5d1836ddfa1a83a9d3369c119eb4716831b8dd</id>
<content type='text'>
The existing /proc workaround only works on Linux.  Symlinks are more
widely available.

Signed-off-by: YAMAMOTO Takashi &lt;yamamoto@valinux.co.jp&gt;
Co-authored-by: Ben Pfaff &lt;blp@nicira.com&gt;
Signed-off-by: Ben Pfaff &lt;blp@nicira.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The existing /proc workaround only works on Linux.  Symlinks are more
widely available.

Signed-off-by: YAMAMOTO Takashi &lt;yamamoto@valinux.co.jp&gt;
Co-authored-by: Ben Pfaff &lt;blp@nicira.com&gt;
Signed-off-by: Ben Pfaff &lt;blp@nicira.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
