<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/NetworkManager.git/examples, branch main</title>
<subtitle>gitlab.freedesktop.org: NetworkManager/NetworkManager.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/'/>
<entry>
<title>examples: support older libnm without NM.SettingOvsOtherConfig in "ovs-external-ids.py"</title>
<updated>2023-02-16T09:17:48+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2023-02-16T09:13:22+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=69d72492447090f5f69a8e96a21cf9de677c96d5'/>
<id>69d72492447090f5f69a8e96a21cf9de677c96d5</id>
<content type='text'>
This example script is used by our NM-ci. Make it work also with libnm
versions that don't yet support NM.SettingOvsOtherConfig.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This example script is used by our NM-ci. Make it work also with libnm
versions that don't yet support NM.SettingOvsOtherConfig.
</pre>
</div>
</content>
</entry>
<entry>
<title>examples: rework "python/gi/show-wifi-networks.py" example</title>
<updated>2023-02-13T09:32:45+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2023-02-09T13:38:26+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=004ffb91cfaedfa2e2d7fdf38f65231f45e66845'/>
<id>004ffb91cfaedfa2e2d7fdf38f65231f45e66845</id>
<content type='text'>
- only printing the scan list is not gonna cut it. It's usually stale,
  and we need to request a new scan.

- don't hard-code the GEnum and GFlags values that we understand. We
  have libnm, which provides us some meta information about the data.
  Use it.

- Some code cleanup.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1531
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- only printing the scan list is not gonna cut it. It's usually stale,
  and we need to request a new scan.

- don't hard-code the GEnum and GFlags values that we understand. We
  have libnm, which provides us some meta information about the data.
  Use it.

- Some code cleanup.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1531
</pre>
</div>
</content>
</entry>
<entry>
<title>ovs: add support for "other_config" settings</title>
<updated>2023-01-11T20:49:36+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2023-01-11T10:51:46+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=a259303e1d5aa593cef2cfdff7b4d7f8c488288e'/>
<id>a259303e1d5aa593cef2cfdff7b4d7f8c488288e</id>
<content type='text'>
See `man ovs-vswitchd.conf.db` for documentation of "other_config" keys.

https://bugzilla.redhat.com/show_bug.cgi?id=2151455
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
See `man ovs-vswitchd.conf.db` for documentation of "other_config" keys.

https://bugzilla.redhat.com/show_bug.cgi?id=2151455
</pre>
</div>
</content>
</entry>
<entry>
<title>examples: add python example for reapply</title>
<updated>2022-12-14T16:31:17+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2022-12-07T10:57:27+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=a467f55bef47056fdd92832337007e5390de47f2'/>
<id>a467f55bef47056fdd92832337007e5390de47f2</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>examples: fix handling "--last" argument in "examples/python/gi/checkpoint.py"</title>
<updated>2022-12-09T09:16:36+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2022-12-09T09:16:16+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=135bbcc0e4f587770ef059ef48cb5501ab72e318'/>
<id>135bbcc0e4f587770ef059ef48cb5501ab72e318</id>
<content type='text'>
Fixes: 3ce3ed4c92fb ('examples: improve finding last checkpoint in "checkpoint.py"')
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes: 3ce3ed4c92fb ('examples: improve finding last checkpoint in "checkpoint.py"')
</pre>
</div>
</content>
</entry>
<entry>
<title>examples: fix code formatting in "gmaincontext.py"</title>
<updated>2022-10-25T14:47:48+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2022-10-25T14:47:33+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=37ccc08abf49b26a6d09bbb7c66517bb2a604b78'/>
<id>37ccc08abf49b26a6d09bbb7c66517bb2a604b78</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>examples: avoid unreachable code in "gmaincontext.py"</title>
<updated>2022-10-25T10:36:43+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2022-10-25T10:36:37+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=c34c8fdb823df72fbc3c2332f5ee08116aab3044'/>
<id>c34c8fdb823df72fbc3c2332f5ee08116aab3044</id>
<content type='text'>
lgtm.com warns about this. Avoid it.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
lgtm.com warns about this. Avoid it.
</pre>
</div>
</content>
</entry>
<entry>
<title>examples: drop unused import from "gmaincontext.py" example</title>
<updated>2022-10-25T10:11:19+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2022-10-25T10:10:46+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=85d5fb210b4d8eabfbfe730c9a7e6eff616d1657'/>
<id>85d5fb210b4d8eabfbfe730c9a7e6eff616d1657</id>
<content type='text'>
Complained by lgtm.com.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Complained by lgtm.com.
</pre>
</div>
</content>
</entry>
<entry>
<title>examples: avoid lgtm warning about calling traceback.format_exception()</title>
<updated>2022-10-25T10:01:54+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2022-10-25T10:01:12+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=9b80860ff420cbd39d58d552d39d130465471af6'/>
<id>9b80860ff420cbd39d58d552d39d130465471af6</id>
<content type='text'>
lgtm.com says:

  Call to function format_exception with too few arguments; should be no
  fewer than 3.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
lgtm.com says:

  Call to function format_exception with too few arguments; should be no
  fewer than 3.
</pre>
</div>
</content>
</entry>
<entry>
<title>libnm: add nm_client_wait_shutdown() function for cleaning up NMClient</title>
<updated>2022-10-14T15:48:24+00:00</updated>
<author>
<name>Thomas Haller</name>
<email>thaller@redhat.com</email>
</author>
<published>2022-10-05T10:22:51+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/NetworkManager.git/commit/?id=88724ff169a1796d4cdfbd4f116e08769de1c12f'/>
<id>88724ff169a1796d4cdfbd4f116e08769de1c12f</id>
<content type='text'>
Add a fire-and-forget function to wait for shutdown to be complete.

It's not entirely trivial to ensure all resources of NMClient are
cleaned up. That matters only if NMClient uses a temporary GMainContext
that the user wants to release while the application continues. For
example, to do some short-lived operations an a worker thread. It's
not trivial also because glib provides no convenient API to integrate
a GMainContext in another GMainContext. We have that code as
nm_utils_g_main_context_create_integrate_source(), so add a helper
function to allow the user to do this.

The function allows to omit the callback, in which case the caller
wouldn't know when shutdown is complete. That would still be useful
however, when integrating the client's context into the caller's
context, so that the client's context gets automatically iterated
until completion.

The following test script will run out of file descriptors,
when wait_shutdown() is not used:

   #!/bin/python

   import gi

   gi.require_version("NM", "1.0")
   from gi.repository import NM, GLib

   for i in range(1200):
       print(f"&gt;&gt;&gt;{i}")

       ctx = GLib.MainContext()
       ctx.push_thread_default()
       nmc = NM.Client.new()
       ctx.pop_thread_default()

       def cb(unused, result, i):
           try:
               NM.Client.wait_shutdown_finish(result)
           except Exception:
               # cannot happen
               assert False
           else:
               print(f"&gt;&gt;&gt;&gt;&gt; {i} complete")

       nmc.wait_shutdown(True, None, cb, i)

       while GLib.MainContext.default().iteration(False):
           pass
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add a fire-and-forget function to wait for shutdown to be complete.

It's not entirely trivial to ensure all resources of NMClient are
cleaned up. That matters only if NMClient uses a temporary GMainContext
that the user wants to release while the application continues. For
example, to do some short-lived operations an a worker thread. It's
not trivial also because glib provides no convenient API to integrate
a GMainContext in another GMainContext. We have that code as
nm_utils_g_main_context_create_integrate_source(), so add a helper
function to allow the user to do this.

The function allows to omit the callback, in which case the caller
wouldn't know when shutdown is complete. That would still be useful
however, when integrating the client's context into the caller's
context, so that the client's context gets automatically iterated
until completion.

The following test script will run out of file descriptors,
when wait_shutdown() is not used:

   #!/bin/python

   import gi

   gi.require_version("NM", "1.0")
   from gi.repository import NM, GLib

   for i in range(1200):
       print(f"&gt;&gt;&gt;{i}")

       ctx = GLib.MainContext()
       ctx.push_thread_default()
       nmc = NM.Client.new()
       ctx.pop_thread_default()

       def cb(unused, result, i):
           try:
               NM.Client.wait_shutdown_finish(result)
           except Exception:
               # cannot happen
               assert False
           else:
               print(f"&gt;&gt;&gt;&gt;&gt; {i} complete")

       nmc.wait_shutdown(True, None, cb, i)

       while GLib.MainContext.default().iteration(False):
           pass
</pre>
</div>
</content>
</entry>
</feed>
