<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/openvswitch.git/python, branch dpdk-hwol</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: Monitor Database table to manage lifecycle of IDL client.</title>
<updated>2019-03-22T20:02:11+00:00</updated>
<author>
<name>Ted Elhourani</name>
<email>ted.elhourani@nutanix.com</email>
</author>
<published>2019-01-25T19:10:01+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/openvswitch.git/commit/?id=c39751e44539a014e642bcd930cb9e3a33af1805'/>
<id>c39751e44539a014e642bcd930cb9e3a33af1805</id>
<content type='text'>
The Python IDL implementation supports ovsdb cluster connections.
This patch is a follow up to commit 31e434fc98, it adds the option of
connecting to the leader (the default) in the Raft-based cluster. It mimics
the exisiting C IDL support for clusters introduced in commit 1b1d2e6daa.

The _Server database schema is first requested, then a monitor of the
Database table in the _Server Database. Method __check_server_db verifies
the eligibility of the server. If the attempt to obtain a monitor of the
_Server database fails and a cluster id was not provided this implementation
proceeds to request the data monitor. If a cluster id was provided via the
set_cluster_id method then the connection is aborted and a connection to a
different node is instead attempted, until a valid cluster node is found.
Thus, when supplied, cluster id is interpreted as the intention to only
allow connections to a clustered database. If not supplied, connections to
standalone nodes, or nodes that do not have the _Server database are
allowed. change_seqno is not incremented in the case of Database table
updates.

Acked-by: Numan Siddique &lt;nusiddiq@redhat.com&gt;
Signed-off-by: Ted Elhourani &lt;ted.elhourani@nutanix.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>
The Python IDL implementation supports ovsdb cluster connections.
This patch is a follow up to commit 31e434fc98, it adds the option of
connecting to the leader (the default) in the Raft-based cluster. It mimics
the exisiting C IDL support for clusters introduced in commit 1b1d2e6daa.

The _Server database schema is first requested, then a monitor of the
Database table in the _Server Database. Method __check_server_db verifies
the eligibility of the server. If the attempt to obtain a monitor of the
_Server database fails and a cluster id was not provided this implementation
proceeds to request the data monitor. If a cluster id was provided via the
set_cluster_id method then the connection is aborted and a connection to a
different node is instead attempted, until a valid cluster node is found.
Thus, when supplied, cluster id is interpreted as the intention to only
allow connections to a clustered database. If not supplied, connections to
standalone nodes, or nodes that do not have the _Server database are
allowed. change_seqno is not incremented in the case of Database table
updates.

Acked-by: Numan Siddique &lt;nusiddiq@redhat.com&gt;
Signed-off-by: Ted Elhourani &lt;ted.elhourani@nutanix.com&gt;
Signed-off-by: Ben Pfaff &lt;blp@ovn.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>python: Fix package requirements with old setuptools</title>
<updated>2019-03-22T14:44:03+00:00</updated>
<author>
<name>Timothy Redaelli</name>
<email>tredaelli@redhat.com</email>
</author>
<published>2019-03-22T14:02:14+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/openvswitch.git/commit/?id=2a6d9168d68d838604d03aa46084cce1b91ebee7'/>
<id>2a6d9168d68d838604d03aa46084cce1b91ebee7</id>
<content type='text'>
Commit 00fcc832d598 ("Update Python package requirements") added a
PEP 508 environment marker to install pywin32 on Windows systems.

This requires a new setuptools version (&gt;= 20.5), but (at least)
RHEL/CentOS7 and Debian Jessie are using an older version of
setuptools and so python extension failed to build.

This commit adds "extras_require" instead of the PEP 508 environment
markers in order to have the conditional dependency of pywin32, but by
remaining compatible with the old setuptools versions.

CC: Alin Gabriel Serdean &lt;aserdean@cloudbasesolutions.com&gt;
CC: Lucian Petrut &lt;lpetrut@cloudbasesolutions.com&gt;
Fixes: 00fcc832d598 ("Update Python package requirements")
Signed-off-by: Timothy Redaelli &lt;tredaelli@redhat.com&gt;
Acked-by: Alin Gabriel Serdean &lt;aserdean@ovn.org&gt;
Signed-off-by: Alin Gabriel Serdean &lt;aserdean@ovn.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Commit 00fcc832d598 ("Update Python package requirements") added a
PEP 508 environment marker to install pywin32 on Windows systems.

This requires a new setuptools version (&gt;= 20.5), but (at least)
RHEL/CentOS7 and Debian Jessie are using an older version of
setuptools and so python extension failed to build.

This commit adds "extras_require" instead of the PEP 508 environment
markers in order to have the conditional dependency of pywin32, but by
remaining compatible with the old setuptools versions.

CC: Alin Gabriel Serdean &lt;aserdean@cloudbasesolutions.com&gt;
CC: Lucian Petrut &lt;lpetrut@cloudbasesolutions.com&gt;
Fixes: 00fcc832d598 ("Update Python package requirements")
Signed-off-by: Timothy Redaelli &lt;tredaelli@redhat.com&gt;
Acked-by: Alin Gabriel Serdean &lt;aserdean@ovn.org&gt;
Signed-off-by: Alin Gabriel Serdean &lt;aserdean@ovn.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>vlog: Better handle syslog handler exceptions.</title>
<updated>2019-02-25T18:57:30+00:00</updated>
<author>
<name>Ilya Maximets</name>
<email>i.maximets@samsung.com</email>
</author>
<published>2019-02-25T17:43:36+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/openvswitch.git/commit/?id=f0e3075ff0d13a10f0605d4508d0dc72d605b5cc'/>
<id>f0e3075ff0d13a10f0605d4508d0dc72d605b5cc</id>
<content type='text'>
'set_levels_from_string' doesn't check for exceptions that could
happen while opening syslog files or connecting to syslog sockets.

For example, if rsyslog stopped on a system:

  $ test-unixctl.py -vFACILITY:daemon --detach
  Traceback (most recent call last):
    File "../../../../tests/test-unixctl.py", line 90, in &lt;module&gt;
      main()
    File "../../../../tests/test-unixctl.py", line 61, in main
      ovs.vlog.handle_args(args)
    File "python/ovs/vlog.py", line 463, in handle_args
      msg = Vlog.set_levels_from_string(verbose)
    File "python/ovs/vlog.py", line 345, in set_levels_from_string
      Vlog.add_syslog_handler(words[1])
    File "python/ovs/vlog.py", line 321, in add_syslog_handler
      facility=syslog_facility)
    File "/python2.7/logging/handlers.py", line 759, in __init__
      self._connect_unixsocket(address)
    File "/python2.7/logging/handlers.py", line 787, in _connect_unixsocket
      self.socket.connect(address)
    File "/python2.7/socket.py", line 224, in meth
      return getattr(self._sock,name)(*args)
  socket.error: [Errno 111] Connection refused

In this case "/dev/log" file exists, so the check inside
'add_syslog_handler' doesn't help.

We need to catch the exceptions in 'set_levels_from_string' same way
as it done in 'init' function.
Also, we don't really need to check for '/dev/log' existence, because
exception will be catched on the upper layer and properly handled by
disabling the corresponding logger.

Fixes: d69d61c7c175 ("vlog: Ability to override the default log facility.")
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>
'set_levels_from_string' doesn't check for exceptions that could
happen while opening syslog files or connecting to syslog sockets.

For example, if rsyslog stopped on a system:

  $ test-unixctl.py -vFACILITY:daemon --detach
  Traceback (most recent call last):
    File "../../../../tests/test-unixctl.py", line 90, in &lt;module&gt;
      main()
    File "../../../../tests/test-unixctl.py", line 61, in main
      ovs.vlog.handle_args(args)
    File "python/ovs/vlog.py", line 463, in handle_args
      msg = Vlog.set_levels_from_string(verbose)
    File "python/ovs/vlog.py", line 345, in set_levels_from_string
      Vlog.add_syslog_handler(words[1])
    File "python/ovs/vlog.py", line 321, in add_syslog_handler
      facility=syslog_facility)
    File "/python2.7/logging/handlers.py", line 759, in __init__
      self._connect_unixsocket(address)
    File "/python2.7/logging/handlers.py", line 787, in _connect_unixsocket
      self.socket.connect(address)
    File "/python2.7/socket.py", line 224, in meth
      return getattr(self._sock,name)(*args)
  socket.error: [Errno 111] Connection refused

In this case "/dev/log" file exists, so the check inside
'add_syslog_handler' doesn't help.

We need to catch the exceptions in 'set_levels_from_string' same way
as it done in 'init' function.
Also, we don't really need to check for '/dev/log' existence, because
exception will be catched on the upper layer and properly handled by
disabling the corresponding logger.

Fixes: d69d61c7c175 ("vlog: Ability to override the default log facility.")
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>Update Python package requirements</title>
<updated>2019-02-25T09:03:27+00:00</updated>
<author>
<name>Lucian Petrut</name>
<email>lpetrut@cloudbasesolutions.com</email>
</author>
<published>2019-02-22T13:24:23+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/openvswitch.git/commit/?id=00fcc832d598d1bd34029f50c2dffac25469e412'/>
<id>00fcc832d598d1bd34029f50c2dffac25469e412</id>
<content type='text'>
The Python ovs package relies on pywin32 for Windows support.
For this reason, pywin32 should be included in the requirements
list.

Signed-off-by: Lucian Petrut &lt;lpetrut@cloudbasesolutions.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The Python ovs package relies on pywin32 for Windows support.
For this reason, pywin32 should be included in the requirements
list.

Signed-off-by: Lucian Petrut &lt;lpetrut@cloudbasesolutions.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>python: Fix E117 over-indented.</title>
<updated>2019-02-12T22:30:19+00:00</updated>
<author>
<name>Ilya Maximets</name>
<email>i.maximets@samsung.com</email>
</author>
<published>2019-02-12T15:34:02+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/openvswitch.git/commit/?id=49b0a93389e3ad3f12ec015d57fb40b16789f193'/>
<id>49b0a93389e3ad3f12ec015d57fb40b16789f193</id>
<content type='text'>
New check was added to recent pycodestyle-2.5.0 and flake8
complains while building on Travis:

  ../utilities/bugtool/ovs-bugtool.in:767:17: E117 over-indented
  ../utilities/bugtool/ovs-bugtool.in:771:17: E117 over-indented
  ../utilities/bugtool/ovs-bugtool.in:774:17: E117 over-indented
  ../utilities/bugtool/ovs-bugtool.in:778:17: E117 over-indented
  ../python/ovs/db/error.py:33:17: E117 over-indented
  ../python/ovs/poller.py:118:21: E117 over-indented
  ../python/ovs/reconnect.py:244:17: E117 over-indented

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>
New check was added to recent pycodestyle-2.5.0 and flake8
complains while building on Travis:

  ../utilities/bugtool/ovs-bugtool.in:767:17: E117 over-indented
  ../utilities/bugtool/ovs-bugtool.in:771:17: E117 over-indented
  ../utilities/bugtool/ovs-bugtool.in:774:17: E117 over-indented
  ../utilities/bugtool/ovs-bugtool.in:778:17: E117 over-indented
  ../python/ovs/db/error.py:33:17: E117 over-indented
  ../python/ovs/poller.py:118:21: E117 over-indented
  ../python/ovs/reconnect.py:244:17: E117 over-indented

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>Un-revert Work around Python/C JSON unicode differences</title>
<updated>2019-01-15T19:16:30+00:00</updated>
<author>
<name>Terry Wilson</name>
<email>twilson@redhat.com</email>
</author>
<published>2019-01-14T14:15:36+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/openvswitch.git/commit/?id=75ff71168a462d4b0e352185f40c1746bd29aa55'/>
<id>75ff71168a462d4b0e352185f40c1746bd29aa55</id>
<content type='text'>
This fix was reverted because it depended on a small bit of code
in a patch that was reverted that changed some python/ovs testing
and build. The fix is still necessary.

The OVS C-based JSON parser operates on bytes, so the parser_feed
function returns the number of bytes that are processed. The pure
Python JSON parser currently operates on unicode, so it expects
that Parser.feed() returns a number of characters. This difference
leads to parsing errors when unicode characters are passed to the
C JSON parser from Python.

Acked-by: Lucas Alvares Gomes &lt;lucasagomes@gmail.com&gt;
Signed-off-by: Terry Wilson &lt;twilson@redhat.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>
This fix was reverted because it depended on a small bit of code
in a patch that was reverted that changed some python/ovs testing
and build. The fix is still necessary.

The OVS C-based JSON parser operates on bytes, so the parser_feed
function returns the number of bytes that are processed. The pure
Python JSON parser currently operates on unicode, so it expects
that Parser.feed() returns a number of characters. This difference
leads to parsing errors when unicode characters are passed to the
C JSON parser from Python.

Acked-by: Lucas Alvares Gomes &lt;lucasagomes@gmail.com&gt;
Signed-off-by: Terry Wilson &lt;twilson@redhat.com&gt;
Signed-off-by: Ben Pfaff &lt;blp@ovn.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>python: Escape backslashes while formatting logs.</title>
<updated>2019-01-15T17:09:53+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=a5b6b6f3a956e72bab0559459455c76641d310ba'/>
<id>a5b6b6f3a956e72bab0559459455c76641d310ba</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: Avoid flake8 warning for unused variables.</title>
<updated>2019-01-11T16:45:10+00:00</updated>
<author>
<name>Ben Pfaff</name>
<email>blp@ovn.org</email>
</author>
<published>2019-01-10T23:23:47+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/openvswitch.git/commit/?id=adb3f0b02762e9e294bdf1466429ad704e7c6335'/>
<id>adb3f0b02762e9e294bdf1466429ad704e7c6335</id>
<content type='text'>
Acked-by: Numan Siddique &lt;nusiddiq@redhat.com&gt;
Tested-by: Numan Siddique &lt;nusiddiq@redhat.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>
Acked-by: Numan Siddique &lt;nusiddiq@redhat.com&gt;
Tested-by: Numan Siddique &lt;nusiddiq@redhat.com&gt;
Signed-off-by: Ben Pfaff &lt;blp@ovn.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>python: Fix invalid escape sequences.</title>
<updated>2019-01-11T16:45:04+00:00</updated>
<author>
<name>Ben Pfaff</name>
<email>blp@ovn.org</email>
</author>
<published>2019-01-10T23:23:45+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/openvswitch.git/commit/?id=145a7e88bbc71b65f4c5015436c9f086a19b5a4a'/>
<id>145a7e88bbc71b65f4c5015436c9f086a19b5a4a</id>
<content type='text'>
It appears that Python silently treats invalid escape sequences in
strings as literals, e.g. "\." is the same as "\\.".  Newer versions of
checkpatch complain, and it does seem reasonable to me to fix these.

Acked-by: Numan Siddique &lt;nusiddiq@redhat.com&gt;
Tested-by: Numan Siddique &lt;nusiddiq@redhat.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>
It appears that Python silently treats invalid escape sequences in
strings as literals, e.g. "\." is the same as "\\.".  Newer versions of
checkpatch complain, and it does seem reasonable to me to fix these.

Acked-by: Numan Siddique &lt;nusiddiq@redhat.com&gt;
Tested-by: Numan Siddique &lt;nusiddiq@redhat.com&gt;
Signed-off-by: Ben Pfaff &lt;blp@ovn.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>nroff: Fix fonts for h2, h3, h4.</title>
<updated>2019-01-10T23:52:05+00:00</updated>
<author>
<name>Ben Pfaff</name>
<email>blp@ovn.org</email>
</author>
<published>2018-11-09T05:39:54+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/openvswitch.git/commit/?id=a31c38ad0baeb6672c7c264a2b69ce198f4a75dd'/>
<id>a31c38ad0baeb6672c7c264a2b69ce198f4a75dd</id>
<content type='text'>
Without this change, the fonts are wrong if a title contains formatting
like &lt;code&gt; or &lt;var&gt;.

Acked-by: Mark Michelson &lt;mmichels@redhat.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>
Without this change, the fonts are wrong if a title contains formatting
like &lt;code&gt; or &lt;var&gt;.

Acked-by: Mark Michelson &lt;mmichels@redhat.com&gt;
Signed-off-by: Ben Pfaff &lt;blp@ovn.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
