Merge lp:~cyphermox/ubuntu/natty/cnetworkmanager/lp677589 into lp:ubuntu/natty/cnetworkmanager

Proposed by Mathieu Trudel-Lapierre
Status: Merged
Merged at revision: 4
Proposed branch: lp:~cyphermox/ubuntu/natty/cnetworkmanager/lp677589
Merge into: lp:ubuntu/natty/cnetworkmanager
Diff against target: 151 lines (+121/-1)
4 files modified
debian/changelog (+9/-0)
debian/control (+2/-1)
debian/patches/nm_0-8-2_dbus_api.patch (+109/-0)
debian/patches/series (+1/-0)
To merge this branch: bzr merge lp:~cyphermox/ubuntu/natty/cnetworkmanager/lp677589
Reviewer Review Type Date Requested Status
Artur Rona (community) Approve
Review via email: mp+41363@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Artur Rona (ari-tczew) wrote :
review: Needs Fixing
5. By Mathieu Trudel-Lapierre

Add missing DEP-3 tags for the patch. Oops.

Revision history for this message
Artur Rona (ari-tczew) wrote :

Please improve debian/changelog entry with following suggestion:

target to natty: s/UNRELEASED/natty

  * debian/patches/nm_0-8-2_dbus_api.patch: Unbreak as much as possible
    of cnetworkmanager to work with NM 0.8.2 and above. Some DBUS API changes broke
    ap listing, connection, etc. Which really should work for the package to be useful.
    (LP: #677589)

update timestamp would be nice.;
add dot at the end of subject tag;
add tag 'Description' before sentence in line 4 (patch), so should look like Description: There has been...

Package built fine.

review: Needs Fixing
6. By Mathieu Trudel-Lapierre

Apply a few more formatting changes suggested by Artur Rona. Thanks!

Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

I'll respectfully disagree on some points:

 - target to Natty; I'm fine with applying this change (and I did), but it's not strictly required. It's also fairly common procedure to submit UNRELEASED changes for sponsoring, then the sponsor will use dch -t or whatnot to release/commit/upload.

 - entry format: I think this is to be left to the individual maintainers. There is no guideline or rule made for how a changelog entry should look, and for other networkmanager packages we've been routinely using the "previous" format (the one I initially had in changelog. That said, I don't feel strongly for either way, so I've updated it.

 - DEP-3 states: "When Subject is used, it is expected that the long description is outside of the structured fields." which is why I've added a short description on the Subject: line, and a long description outside of structured fields.

Revision history for this message
Artur Rona (ari-tczew) wrote :

Now looks good. Please reconsider forwarding this patch to Debian and upstream.

Thank you for your contribution!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2010-09-06 19:49:12 +0000
3+++ debian/changelog 2010-12-08 15:56:33 +0000
4@@ -1,3 +1,12 @@
5+cnetworkmanager (0.21.1-1.1ubuntu1) natty; urgency=low
6+
7+ * debian/patches/nm_0-8-2_dbus_api.patch: Unbreak as much as possible
8+ of cnetworkmanager to work with NM 0.8.2 and above. Some DBUS API
9+ changes broke ap listing, connection, etc. Which really should work
10+ for the package to be useful. (LP: #677589)
11+
12+ -- Mathieu Trudel-Lapierre <mathieu-tl@ubuntu.com> Wed, 08 Dec 2010 10:52:08 -0500
13+
14 cnetworkmanager (0.21.1-1.1) unstable; urgency=low
15
16 * Non-maintainer upload.
17
18=== modified file 'debian/control'
19--- debian/control 2010-09-06 19:49:12 +0000
20+++ debian/control 2010-12-08 15:56:33 +0000
21@@ -1,7 +1,8 @@
22 Source: cnetworkmanager
23 Section: net
24 Priority: extra
25-Maintainer: Python Applications Packaging Team <python-apps-team@lists.alioth.debian.org>
26+Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
27+XSBC-Original-Maintainer: Python Applications Packaging Team <python-apps-team@lists.alioth.debian.org>
28 Uploaders: W. Martin Borgert <debacle@debian.org>
29 Build-Depends: cdbs, debhelper (>= 7), python, python-support, xsltproc, docbook-xsl
30 Standards-Version: 3.8.4
31
32=== added directory 'debian/patches'
33=== added file 'debian/patches/nm_0-8-2_dbus_api.patch'
34--- debian/patches/nm_0-8-2_dbus_api.patch 1970-01-01 00:00:00 +0000
35+++ debian/patches/nm_0-8-2_dbus_api.patch 2010-12-08 15:56:33 +0000
36@@ -0,0 +1,109 @@
37+From: Mathieu Trudel-Lapierre <mathieu.trudel-lapierre@canonical.com>
38+Subject: Have cnetworkmanager deal with NM 0.8.2's DBus API.
39+Bug-Ubuntu: https://launchpad.net/bugs/677589
40+
41+There has been a number of changes in the API for NM since the last
42+upstream release of cnetworkmanager, and even more with the release
43+of NetworkManager 0.8.2. Attempt to cope with the new API in two ways:
44+
45+ 1) Set the correct DBus API Interface for Wired / Wireless devices
46+ 2) Attempt a basic level of support for inheritance of DBus interfaces
47+
48+The second is done by providing a "base interface" from which different
49+types of devices could "inherit" or require to use.
50+
51+One a first call with the "real" interface specific to a device fails
52+with an AccessDenied DBus error, try a second time to issue the call
53+with the base interface for .Device. In reality, there aren't really
54+so many more levels of inheritance in devices types past that.
55+
56+Index: cnetworkmanager-0.21.1/dbusclient/__init__.py
57+===================================================================
58+--- cnetworkmanager-0.21.1.orig/dbusclient/__init__.py 2010-11-19 12:26:55.076768001 -0500
59++++ cnetworkmanager-0.21.1/dbusclient/__init__.py 2010-11-19 12:27:03.946768001 -0500
60+@@ -35,10 +35,13 @@
61+ if introspection does not provide it for a method/property
62+ """
63+
64+- # FIXME common for this class, all classes?
65+ self.__default_interface = kwargs.pop("default_interface", None)
66++
67+ super(DBusMio, self).__init__(conn, bus_name, object_path, introspect, follow_name_owner_changes, **kwargs)
68+
69++ def set_base_iface(self, iface):
70++ self.__base_interface = iface
71++
72+ def __getattr__(self, name):
73+ """Proxied DBus methods.
74+
75+@@ -72,9 +75,14 @@
76+ """
77+
78+ iface = self.__default_interface # TODO cache
79++ base_iface = self.__base_interface
80+ # TODO _introspect_property_map
81+ pmi = dbus.Interface(self, "org.freedesktop.DBus.Properties")
82+- return pmi.Get(iface, key, byte_arrays=True)
83++ try:
84++ return pmi.Get(iface, key, byte_arrays=True)
85++ except dbus.exceptions.DBusException, e:
86++ if "AccessDenied" in e.get_dbus_name():
87++ return pmi.Get(base_iface, key, byte_arrays=True)
88+
89+ def __setitem__(self, key, value):
90+ """Proxies DBus properties as dictionary items.
91+@@ -89,7 +97,9 @@
92+ iface = self.__default_interface # TODO cache
93+ # TODO _introspect_property_map
94+ pmi = dbus.Interface(self, "org.freedesktop.DBus.Properties")
95+- return pmi.Set(iface, key, value, byte_arrays=True)
96++ pmi_res = pmi.Set(iface, key, value, byte_arrays=True)
97++ if not pmi_res:
98++ return pmi.Set(base_iface, key, value, byte_arrays=True)
99+
100+ def _mklist(x):
101+ """Return a list.
102+@@ -112,6 +122,8 @@
103+ "properties": {},
104+ }
105+
106++ def set_base_iface(self, iface):
107++ super(DBusClient, self).set_base_iface(iface)
108+
109+ @classmethod
110+ def _get_adaptor(cls, kind, name):
111+Index: cnetworkmanager-0.21.1/networkmanager/device.py
112+===================================================================
113+--- cnetworkmanager-0.21.1.orig/networkmanager/device.py 2010-11-19 12:27:00.316768002 -0500
114++++ cnetworkmanager-0.21.1/networkmanager/device.py 2010-11-19 12:27:03.946768001 -0500
115+@@ -162,6 +162,8 @@
116+ def __init__(self, opath):
117+ """Inits the base class, unlike _create"""
118+ super(Device, self).__init__(dbus.SystemBus(), self.SERVICE, opath, default_interface = self.IFACE)
119++ if self.BASE_IFACE:
120++ super(Device, self).set_base_iface(self.BASE_IFACE)
121+
122+
123+ _constructors = {}
124+@@ -209,8 +211,9 @@
125+ def _settings_type(cls):
126+ return "802-3-ethernet"
127+
128+- # FIXME but also use parent iface
129+- IFACE = "org.freedesktop.NetworkManager.Device"
130++ IFACE = "org.freedesktop.NetworkManager.Device.Wired"
131++ BASE_IFACE = "org.freedesktop.NetworkManager.Device"
132++
133+ # FIXME how to get parent adaptors?
134+ Wired._add_adaptors(
135+ # PropertiesChanged = SA(identity),
136+@@ -238,6 +241,9 @@
137+ def _settings_type(cls):
138+ return "802-11-wireless"
139+
140++ IFACE = "org.freedesktop.NetworkManager.Device.Wireless"
141++ BASE_IFACE = "org.freedesktop.NetworkManager.Device"
142++
143+ Wireless._add_adaptors(
144+ GetAccessPoints = MA(seq_adaptor(AccessPoint)),
145+
146
147=== added file 'debian/patches/series'
148--- debian/patches/series 1970-01-01 00:00:00 +0000
149+++ debian/patches/series 2010-12-08 15:56:33 +0000
150@@ -0,0 +1,1 @@
151+nm_0-8-2_dbus_api.patch

Subscribers

People subscribed via source and target branches