<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/openvswitch.git/python, branch v1.9.0</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>daemon: Start monitor process, not daemon process, in new session.</title>
<updated>2012-12-13T22:33:52+00:00</updated>
<author>
<name>Ben Pfaff</name>
<email>blp@nicira.com</email>
</author>
<published>2012-12-13T22:01:23+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/openvswitch.git/commit/?id=6563d66e8305d35d43d6d42ff3491493bf600a2f'/>
<id>6563d66e8305d35d43d6d42ff3491493bf600a2f</id>
<content type='text'>
To keep control+C and other signals in the initiating session from killing
the monitor process, we need to put the monitor process into its own
session.  However, until this point, we've only done that for the daemon
processes that the monitor started, which means that control+C would kill
the monitor but not the daemons that it launched.

I don't know of a benefit to putting the monitor and daemon processes in
different sessions, as opposed to one new session for both of them, so
this change does the latter.

daemonize_post_detach() is called from one additional context where we'd
want to be in a new session, the worker_start() function, but that function
is documented as to be called after daemonize_start(), in which case we
will (after this commit) already have called setsid(), so no additional
change is required there.

Bug #14280.
Reported-by: Gordon Good &lt;ggood@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>
To keep control+C and other signals in the initiating session from killing
the monitor process, we need to put the monitor process into its own
session.  However, until this point, we've only done that for the daemon
processes that the monitor started, which means that control+C would kill
the monitor but not the daemons that it launched.

I don't know of a benefit to putting the monitor and daemon processes in
different sessions, as opposed to one new session for both of them, so
this change does the latter.

daemonize_post_detach() is called from one additional context where we'd
want to be in a new session, the worker_start() function, but that function
is documented as to be called after daemonize_start(), in which case we
will (after this commit) already have called setsid(), so no additional
change is required there.

Bug #14280.
Reported-by: Gordon Good &lt;ggood@nicira.com&gt;
Signed-off-by: Ben Pfaff &lt;blp@nicira.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>python/ovs/stream: Fix Stream.connect() retval for incomplete connection.</title>
<updated>2012-11-22T06:11:16+00:00</updated>
<author>
<name>Ben Pfaff</name>
<email>blp@nicira.com</email>
</author>
<published>2012-11-22T06:09:55+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/openvswitch.git/commit/?id=892a2b9db8d58a67f713ff6a2a76ac29eb697a9e'/>
<id>892a2b9db8d58a67f713ff6a2a76ac29eb697a9e</id>
<content type='text'>
If the loop condition in Stream.connect() was false, which is especially
likely for TCP connections, then Stream.connect() would return None,
which violates its documented behavior.  This commit fixes the problem.

Reported-by: Isaku Yamahata &lt;yamahata@valinux.co.jp&gt;
Tested-by: Isaku Yamahata &lt;yamahata@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>
If the loop condition in Stream.connect() was false, which is especially
likely for TCP connections, then Stream.connect() would return None,
which violates its documented behavior.  This commit fixes the problem.

Reported-by: Isaku Yamahata &lt;yamahata@valinux.co.jp&gt;
Tested-by: Isaku Yamahata &lt;yamahata@valinux.co.jp&gt;
Signed-off-by: Ben Pfaff &lt;blp@nicira.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>stream.py: un-decorator Stream.register_method</title>
<updated>2012-10-17T18:22:08+00:00</updated>
<author>
<name>Isaku Yamahata</name>
<email>yamahata@valinux.co.jp</email>
</author>
<published>2012-10-17T18:18:16+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/openvswitch.git/commit/?id=f7b7ee9753cd75da86c21ac6364dab07e5e8d51a'/>
<id>f7b7ee9753cd75da86c21ac6364dab07e5e8d51a</id>
<content type='text'>
c38f8724aeb994fd840fa4283a07e38c3c114d68 made stream.py not use class
decorator. So Stream.register need not to be decorator any more.
So simplify it.

Signed-off-by: Isaku Yamahata &lt;yamahata@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>
c38f8724aeb994fd840fa4283a07e38c3c114d68 made stream.py not use class
decorator. So Stream.register need not to be decorator any more.
So simplify it.

Signed-off-by: Isaku Yamahata &lt;yamahata@valinux.co.jp&gt;
Signed-off-by: Ben Pfaff &lt;blp@nicira.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>stream.py: Don't use class decorators.</title>
<updated>2012-10-17T00:41:26+00:00</updated>
<author>
<name>Reid Price</name>
<email>reid@nicira.com</email>
</author>
<published>2012-10-17T00:23:26+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/openvswitch.git/commit/?id=c38f8724aeb994fd840fa4283a07e38c3c114d68'/>
<id>c38f8724aeb994fd840fa4283a07e38c3c114d68</id>
<content type='text'>
Commit 8cc820 (python/ovs/stream: teach stream.py tcp socket) made a
change that used class decorators.  Unfortunately, they were not
introduced until Python 2.6.  XenServer uses Python 2.4, so the change
caused some Python-based daemons not to start.  This commit uses an
alternate syntax suggested by Reid Price.

Bug #13580

Signed-off-by: Justin Pettit &lt;jpettit@nicira.com&gt;
Signed-off-by: Reid Price &lt;reid@nicira.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Commit 8cc820 (python/ovs/stream: teach stream.py tcp socket) made a
change that used class decorators.  Unfortunately, they were not
introduced until Python 2.6.  XenServer uses Python 2.4, so the change
caused some Python-based daemons not to start.  This commit uses an
alternate syntax suggested by Reid Price.

Bug #13580

Signed-off-by: Justin Pettit &lt;jpettit@nicira.com&gt;
Signed-off-by: Reid Price &lt;reid@nicira.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>python/ovs/socket_util: don't use Exception, but ValueError</title>
<updated>2012-10-16T17:19:49+00:00</updated>
<author>
<name>Isaku Yamahata</name>
<email>yamahata@valinux.co.jp</email>
</author>
<published>2012-10-15T21:57:27+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/openvswitch.git/commit/?id=378cc7f11274b21e6cc837129166b24a5281aa3c'/>
<id>378cc7f11274b21e6cc837129166b24a5281aa3c</id>
<content type='text'>
67656b9ff297f305b3bfcca2868e8e870e108283
used Exception, but it should be more specific error.
Use ValueError instread of Exception.

Suggested-by: Reid Price &lt;reid@nicira.com&gt;
Signed-off-by: Isaku Yamahata &lt;yamahata@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>
67656b9ff297f305b3bfcca2868e8e870e108283
used Exception, but it should be more specific error.
Use ValueError instread of Exception.

Suggested-by: Reid Price &lt;reid@nicira.com&gt;
Signed-off-by: Isaku Yamahata &lt;yamahata@valinux.co.jp&gt;
Signed-off-by: Ben Pfaff &lt;blp@nicira.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>python/ovs/stream: teach stream.py tcp socket</title>
<updated>2012-10-15T17:22:53+00:00</updated>
<author>
<name>Isaku Yamahata</name>
<email>yamahata@valinux.co.jp</email>
</author>
<published>2012-09-27T09:28:08+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/openvswitch.git/commit/?id=e06d06a7b3386cd7a60fae1b77ae0acedf42c3e3'/>
<id>e06d06a7b3386cd7a60fae1b77ae0acedf42c3e3</id>
<content type='text'>
Signed-off-by: Isaku Yamahata &lt;yamahata@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>
Signed-off-by: Isaku Yamahata &lt;yamahata@valinux.co.jp&gt;
Signed-off-by: Ben Pfaff &lt;blp@nicira.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>python/ovs/socket_util: add tcp related helper functions which will be used by tcp</title>
<updated>2012-10-15T17:18:47+00:00</updated>
<author>
<name>Isaku Yamahata</name>
<email>yamahata@valinux.co.jp</email>
</author>
<published>2012-09-27T09:28:07+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/openvswitch.git/commit/?id=67656b9ff297f305b3bfcca2868e8e870e108283'/>
<id>67656b9ff297f305b3bfcca2868e8e870e108283</id>
<content type='text'>
Signed-off-by: Isaku Yamahata &lt;yamahata@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>
Signed-off-by: Isaku Yamahata &lt;yamahata@valinux.co.jp&gt;
Signed-off-by: Ben Pfaff &lt;blp@nicira.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>python/ovs/db/idl: getattr(Row) raises TypeError, not AttributeError.</title>
<updated>2012-09-27T16:11:49+00:00</updated>
<author>
<name>Isaku Yamahata</name>
<email>yamahata@valinux.co.jp</email>
</author>
<published>2012-09-27T09:29:45+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/openvswitch.git/commit/?id=3b4c362f4078549d9a3bf18a2393e12e4b3ff9f7'/>
<id>3b4c362f4078549d9a3bf18a2393e12e4b3ff9f7</id>
<content type='text'>
In some cases getattr(Row instance, attrname) doesn't raise AttributeError,
but TypeError

&gt; File "python/ovs/db/idl.py", line 554, in __getattr__
&gt;     datum = self._data[column_name]
&gt; TypeError: 'NoneType' object has no attribute '__getitem__'

So getattr(Row instance, attrname, default value) doesn't work.
This occurs when row._changes doesn't include attrname and row._data is None.
So teach Row.__getattr__ _data=None case.

Signed-off-by: Isaku Yamahata &lt;yamahata@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>
In some cases getattr(Row instance, attrname) doesn't raise AttributeError,
but TypeError

&gt; File "python/ovs/db/idl.py", line 554, in __getattr__
&gt;     datum = self._data[column_name]
&gt; TypeError: 'NoneType' object has no attribute '__getitem__'

So getattr(Row instance, attrname, default value) doesn't work.
This occurs when row._changes doesn't include attrname and row._data is None.
So teach Row.__getattr__ _data=None case.

Signed-off-by: Isaku Yamahata &lt;yamahata@valinux.co.jp&gt;
Signed-off-by: Ben Pfaff &lt;blp@nicira.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>jsonrpc: Fix Python implementation of inactivity logic.</title>
<updated>2012-09-18T17:23:01+00:00</updated>
<author>
<name>Ben Pfaff</name>
<email>blp@nicira.com</email>
</author>
<published>2012-09-14T20:09:33+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/openvswitch.git/commit/?id=ab678217dd626b1bf3f17f784272438e46190834'/>
<id>ab678217dd626b1bf3f17f784272438e46190834</id>
<content type='text'>
When a JSON-RPC session receives bytes, or when it successfully sends
queued bytes, then it should count that as activity.  However, the code
here was reversed, in that it used the wrong check in each place.  That is,
when it tried to receive data, it would check whether data had just been
sent, and when it tried to send data, it would check whether data had just
been received.  Neither one makes sense and doesn't work.

Bug #13214.
Reported-by: Luca Giraudo &lt;lgiraudo@nicira.com&gt;
CC: James Schmidt &lt;jschmidt@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>
When a JSON-RPC session receives bytes, or when it successfully sends
queued bytes, then it should count that as activity.  However, the code
here was reversed, in that it used the wrong check in each place.  That is,
when it tried to receive data, it would check whether data had just been
sent, and when it tried to send data, it would check whether data had just
been received.  Neither one makes sense and doesn't work.

Bug #13214.
Reported-by: Luca Giraudo &lt;lgiraudo@nicira.com&gt;
CC: James Schmidt &lt;jschmidt@nicira.com&gt;
Signed-off-by: Ben Pfaff &lt;blp@nicira.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>python/ovs/db/idl.py: Transaction._substitute doesn't handle list/tuple</title>
<updated>2012-09-13T05:22:18+00:00</updated>
<author>
<name>Isaku Yamahata</name>
<email>yamahata@valinux.co.jp</email>
</author>
<published>2012-09-13T04:41:04+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/openvswitch.git/commit/?id=225b582a8c218eec242921b0eed291cf6ec19b76'/>
<id>225b582a8c218eec242921b0eed291cf6ec19b76</id>
<content type='text'>
Since Transaction._substitute doesn't substitute elements of list/tuple,
setting list references results in transaction error. Teach it such case.

Example:
{"op": "update",
 "row":{"bridges":["set",[["uuid",
                           "1f42bc19-307f-42e7-a9c0-c12178bd8b51"],
                          ["uuid",
                           "f97e0c76-7146-489d-9bed-29bc704f65fe"]]]},
 "table": "Open_vSwitch",
 "where":[["_uuid", "==", ["uuid",
                           "20c2a046-ae7e-4453-a576-11034db24985"]]]}

In the above case, uuid in "row" aren't replaced by "named-uuid" because
the function doesn't look into elements of lists.
When list/tuple is found, look into elements recursively.

Signed-off-by: Isaku Yamahata &lt;yamahata@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>
Since Transaction._substitute doesn't substitute elements of list/tuple,
setting list references results in transaction error. Teach it such case.

Example:
{"op": "update",
 "row":{"bridges":["set",[["uuid",
                           "1f42bc19-307f-42e7-a9c0-c12178bd8b51"],
                          ["uuid",
                           "f97e0c76-7146-489d-9bed-29bc704f65fe"]]]},
 "table": "Open_vSwitch",
 "where":[["_uuid", "==", ["uuid",
                           "20c2a046-ae7e-4453-a576-11034db24985"]]]}

In the above case, uuid in "row" aren't replaced by "named-uuid" because
the function doesn't look into elements of lists.
When list/tuple is found, look into elements recursively.

Signed-off-by: Isaku Yamahata &lt;yamahata@valinux.co.jp&gt;
Signed-off-by: Ben Pfaff &lt;blp@nicira.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
