Merge lp:~adam-collard/landscape-client/drop-dbus into lp:~landscape/landscape-client/trunk
- drop-dbus
- Merge into trunk
Proposed by
Adam Collard
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Adam Collard | ||||
Approved revision: | 929 | ||||
Merged at revision: | 930 | ||||
Proposed branch: | lp:~adam-collard/landscape-client/drop-dbus | ||||
Merge into: | lp:~landscape/landscape-client/trunk | ||||
Diff against target: |
979 lines (+29/-626) 28 files modified
Makefile (+0/-7) README (+3/-7) dbus-1/landscape.conf (+0/-50) debian/changelog (+6/-0) debian/control (+2/-2) debian/landscape-client.install (+0/-3) debian/landscape-client.manpages (+0/-1) debian/landscape-client.postinst (+0/-11) debian/landscape-common.postinst (+3/-3) debian/landscape-common.prerm (+1/-1) debian/rules (+0/-18) debian/source.lintian-overrides (+1/-12) dev/run-piuparts (+0/-14) landscape/broker/exchange.py (+1/-2) landscape/lib/bpickle_dbus.py (+0/-65) landscape/service.py (+0/-6) landscape/tests/test_service.py (+0/-9) landscape/tests/test_textmessage.py (+0/-112) landscape/textmessage.py (+0/-103) landscape/watchdog.py (+2/-4) man/landscape-client.1 (+5/-5) man/landscape-config.1 (+2/-2) man/landscape-message.1 (+0/-51) man/landscape-message.txt (+0/-32) man/landscape-sysinfo.1 (+2/-2) scripts/landscape-dbus-proxy (+0/-91) scripts/landscape-message (+0/-8) setup.py (+1/-5) |
||||
To merge this branch: | bzr merge lp:~adam-collard/landscape-client/drop-dbus | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
🤖 Landscape Builder | test results | Approve | |
Free Ekanayaka (community) | Approve | ||
Alberto Donato (community) | Approve | ||
Review via email:
|
Commit message
Remove dead dbus code and textmessage (confirmed not supported in server for ~2 years).
Drive-by fixes for lintian complaints.
Description of the change
Remove dead dbus code and textmessage (confirmed not supported in server for ~2 years).
Drive-by fixes for lintian complaints.
Testing instructions:
* make check
* make package
* Install package locally, confirm server integration tests pass
To post a comment you must log in.
- 928. By Adam Collard
-
Merge from trunk
Revision history for this message
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
🤖 Landscape Builder (landscape-builder) : | # |
review:
Abstain
(executing tests)
Revision history for this message
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
🤖 Landscape Builder (landscape-builder) wrote : | # |
review:
Approve
(test results)
Revision history for this message
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Free Ekanayaka (free.ekanayaka) wrote : | # |
I can't see anything harmful, so KIWF! +1
review:
Approve
- 929. By Adam Collard
-
Drop unnecesary variable for use_dhpython2 since we always use it.
Revision history for this message
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Adam Collard (adam-collard) : | # |
Revision history for this message
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
🤖 Landscape Builder (landscape-builder) : | # |
review:
Abstain
(executing tests)
Revision history for this message
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
🤖 Landscape Builder (landscape-builder) wrote : | # |
Command: TRIAL_ARGS=-j4 make check
Result: Success
Revno: 929
Branch: lp:~adam-collard/landscape-client/drop-dbus
Jenkins: https:/
review:
Approve
(test results)
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'Makefile' |
2 | --- Makefile 2016-06-17 00:17:50 +0000 |
3 | +++ Makefile 2017-01-18 09:59:00 +0000 |
4 | @@ -23,12 +23,6 @@ |
5 | $(PYTHON) setup.py build_ext -i |
6 | |
7 | check: build |
8 | - @if [ -z "$$DBUS_SESSION_BUS_ADDRESS" ]; then \ |
9 | - OUTPUT=`dbus-daemon --print-address=1 --print-pid=1 --session --fork`; \ |
10 | - export DBUS_SESSION_BUS_ADDRESS=`echo $$OUTPUT | cut -f1 -d ' '`; \ |
11 | - DBUS_PID=`echo $$OUTPUT | cut -f2 -d ' '`; \ |
12 | - trap "kill $$DBUS_PID" EXIT; \ |
13 | - fi; \ |
14 | if [ -z "$$DISPLAY" ]; then \ |
15 | xvfb-run $(TEST_COMMAND); \ |
16 | else \ |
17 | @@ -60,7 +54,6 @@ |
18 | manpages: |
19 | LC_ALL=C ${TXT2MAN} -P Landscape -s 1 -t landscape-client < man/landscape-client.txt > man/landscape-client.1 |
20 | LC_ALL=C ${TXT2MAN} -P Landscape -s 1 -t landscape-config < man/landscape-config.txt > man/landscape-config.1 |
21 | - LC_ALL=C ${TXT2MAN} -P Landscape -s 1 -t landscape-message < man/landscape-message.txt > man/landscape-message.1 |
22 | LC_ALL=C ${TXT2MAN} -P Landscape -s 1 -t landscape-sysinfo < man/landscape-sysinfo.txt > man/landscape-sysinfo.1 |
23 | |
24 | origtarball: sdist |
25 | |
26 | === modified file 'README' |
27 | --- README 2012-03-05 14:11:42 +0000 |
28 | +++ README 2017-01-18 09:59:00 +0000 |
29 | @@ -23,13 +23,9 @@ |
30 | |
31 | == Developing == |
32 | |
33 | -To run the full test suite, you must have a dbus session bus |
34 | -running. If you don't have one (for example, if you're running the |
35 | -tests in an ssh session), run the following command: |
36 | - |
37 | -export DBUS_SESSION_BUS_ADDRESS=`dbus-daemon --print-address=1 --session --fork` |
38 | - |
39 | -Then your tests should pass. |
40 | +To run the full test suite, run the following command: |
41 | + |
42 | +make check |
43 | |
44 | When you want to test the landscape client manually without management |
45 | features, you can simply run: |
46 | |
47 | === removed directory 'dbus-1' |
48 | === removed file 'dbus-1/landscape.conf' |
49 | --- dbus-1/landscape.conf 2013-05-20 07:28:42 +0000 |
50 | +++ dbus-1/landscape.conf 1970-01-01 00:00:00 +0000 |
51 | @@ -1,50 +0,0 @@ |
52 | -<!DOCTYPE busconfig PUBLIC |
53 | - "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN" |
54 | - "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd"> |
55 | -<busconfig> |
56 | - |
57 | - <policy user="landscape"> |
58 | - <allow own="com.canonical.landscape.Broker" /> |
59 | - <allow own="com.canonical.landscape.Monitor" /> |
60 | - |
61 | - <allow send_destination="com.canonical.landscape.Broker" /> |
62 | - <allow receive_sender="com.canonical.landscape.Broker" /> |
63 | - |
64 | - <allow send_destination="com.canonical.landscape.Monitor" /> |
65 | - <allow receive_sender="com.canonical.landscape.Monitor" /> |
66 | - |
67 | - <allow send_destination="com.canonical.landscape.Manager" /> |
68 | - <allow receive_sender="com.canonical.landscape.Manager" /> |
69 | - |
70 | - </policy> |
71 | - |
72 | - <policy user="root"> |
73 | - <allow own="com.canonical.landscape.Manager" /> |
74 | - |
75 | - <allow send_destination="com.canonical.landscape.Broker" /> |
76 | - <allow receive_sender="com.canonical.landscape.Broker" /> |
77 | - |
78 | - <allow send_destination="com.canonical.landscape.Monitor" /> |
79 | - <allow receive_sender="com.canonical.landscape.Monitor" /> |
80 | - |
81 | - <allow send_destination="com.canonical.landscape.Manager" /> |
82 | - <allow receive_sender="com.canonical.landscape.Manager" /> |
83 | - </policy> |
84 | - |
85 | - <policy context="default"> |
86 | - <deny own="com.canonical.landscape.Broker" /> |
87 | - <deny own="com.canonical.landscape.Monitor" /> |
88 | - <deny own="com.canonical.landscape.Manager" /> |
89 | - |
90 | - <deny send_destination="com.canonical.landscape.Broker" /> |
91 | - <deny receive_sender="com.canonical.landscape.Broker" /> |
92 | - |
93 | - <deny send_destination="com.canonical.landscape.Monitor" /> |
94 | - <deny receive_sender="com.canonical.landscape.Monitor" /> |
95 | - |
96 | - <deny send_destination="com.canonical.landscape.Manager" /> |
97 | - <deny receive_sender="com.canonical.landscape.Manager" /> |
98 | - |
99 | - </policy> |
100 | - |
101 | -</busconfig> |
102 | |
103 | === modified file 'debian/changelog' |
104 | --- debian/changelog 2016-12-20 17:31:16 +0000 |
105 | +++ debian/changelog 2017-01-18 09:59:00 +0000 |
106 | @@ -1,3 +1,9 @@ |
107 | +landscape-client (16.08+bzr925-0ubuntu0) xenial; urgency=medium |
108 | + |
109 | + * New local test build |
110 | + |
111 | + -- Adam Collard <adam.collard@canonical.com> Wed, 18 Jan 2017 09:11:33 +0000 |
112 | + |
113 | landscape-client (16.08-0ubuntu1) UNRELEASED; urgency=medium |
114 | |
115 | * New trunk build |
116 | |
117 | === modified file 'debian/control' |
118 | --- debian/control 2016-03-23 08:14:06 +0000 |
119 | +++ debian/control 2017-01-18 09:59:00 +0000 |
120 | @@ -25,7 +25,7 @@ |
121 | Suggests: ${extra:Suggests} |
122 | Breaks: landscape-client-ui (<< 16.04), landscape-client-ui-install (<< 16.04) |
123 | Replaces: landscape-client-ui (<< 16.04), landscape-client-ui-install (<< 16.04) |
124 | -Description: The Landscape administration system client - Common files |
125 | +Description: Landscape administration system client - Common files |
126 | Landscape is a web-based tool for managing Ubuntu systems. This |
127 | package is necessary if you want your machine to be managed in a |
128 | Landscape account. |
129 | @@ -41,7 +41,7 @@ |
130 | python-pycurl, |
131 | landscape-common (= ${binary:Version}) |
132 | Suggests: ${extra:Suggests} |
133 | -Description: The Landscape administration system client |
134 | +Description: Landscape administration system client |
135 | Landscape is a web-based tool for managing Ubuntu systems. This |
136 | package is necessary if you want your machine to be managed in a |
137 | Landscape account. |
138 | |
139 | === modified file 'debian/landscape-client.install' |
140 | --- debian/landscape-client.install 2016-01-07 10:45:00 +0000 |
141 | +++ debian/landscape-client.install 2017-01-18 09:59:00 +0000 |
142 | @@ -2,11 +2,8 @@ |
143 | usr/bin/landscape-client |
144 | usr/bin/landscape-config |
145 | usr/bin/landscape-manager |
146 | -usr/bin/landscape-message |
147 | usr/bin/landscape-monitor |
148 | usr/bin/landscape-package-changer |
149 | usr/bin/landscape-package-reporter |
150 | usr/bin/landscape-release-upgrader |
151 | -usr/bin/landscape-dbus-proxy |
152 | usr/lib/landscape |
153 | -etc/dbus-1/system.d/landscape.conf |
154 | |
155 | === modified file 'debian/landscape-client.manpages' |
156 | --- debian/landscape-client.manpages 2012-09-26 14:04:47 +0000 |
157 | +++ debian/landscape-client.manpages 2017-01-18 09:59:00 +0000 |
158 | @@ -1,3 +1,2 @@ |
159 | man/landscape-client.1 |
160 | man/landscape-config.1 |
161 | -man/landscape-message.1 |
162 | |
163 | === modified file 'debian/landscape-client.postinst' (properties changed: -x to +x) |
164 | --- debian/landscape-client.postinst 2016-08-15 15:22:40 +0000 |
165 | +++ debian/landscape-client.postinst 2017-01-18 09:59:00 +0000 |
166 | @@ -98,17 +98,6 @@ |
167 | dpkg-statoverride --update --add root landscape 4754 $apt_update |
168 | fi |
169 | |
170 | - # Check if we're upgrading from a D-Bus version like the client in the |
171 | - # lucid archives. |
172 | - if ! [ -z $2 ]; then |
173 | - if dpkg --compare-versions $2 lt 1.5.1; then |
174 | - # Launch a proxy service that will forward requests over DBus |
175 | - # from the old package-changer to the new AMP-based broker. This |
176 | - # is a one-off only needed for the DBus->AMP upgrade |
177 | - start-stop-daemon -x /usr/bin/landscape-dbus-proxy -b -c landscape -u landscape -S |
178 | - fi |
179 | - fi |
180 | - |
181 | # In response to bug 1508110 we need to trigger a complete update of |
182 | # user information. The flag file will be removed by the client when |
183 | # the update completes. |
184 | |
185 | === modified file 'debian/landscape-common.postinst' (properties changed: -x to +x) |
186 | --- debian/landscape-common.postinst 2016-09-16 09:58:18 +0000 |
187 | +++ debian/landscape-common.postinst 2017-01-18 09:59:00 +0000 |
188 | @@ -41,14 +41,14 @@ |
189 | if [ "$RET" = "Cache sysinfo in /etc/motd" ]; then |
190 | rm -f $PROFILE_LOCATION 2>/dev/null || true |
191 | ln -sf $WRAPPER $UPDATE_MOTD_LOCATION |
192 | - /usr/sbin/update-motd 2>/dev/null || true |
193 | + update-motd 2>/dev/null || true |
194 | elif [ "$RET" = "Run sysinfo on every login" ]; then |
195 | rm -f $UPDATE_MOTD_LOCATION 2>/dev/null || true |
196 | - /usr/sbin/update-motd 2>/dev/null || true |
197 | + update-motd 2>/dev/null || true |
198 | ln -sf $WRAPPER $PROFILE_LOCATION |
199 | else |
200 | rm -f $UPDATE_MOTD_LOCATION 2>/dev/null || true |
201 | - /usr/sbin/update-motd 2>/dev/null || true |
202 | + update-motd 2>/dev/null || true |
203 | rm -f $PROFILE_LOCATION || true |
204 | fi |
205 | |
206 | |
207 | === modified file 'debian/landscape-common.prerm' (properties changed: -x to +x) |
208 | --- debian/landscape-common.prerm 2016-09-16 10:05:55 +0000 |
209 | +++ debian/landscape-common.prerm 2017-01-18 09:59:00 +0000 |
210 | @@ -21,7 +21,7 @@ |
211 | remove|upgrade|deconfigure) |
212 | dpkg-divert --remove --package landscape-common --rename /etc/update-motd.d/90-updates-available |
213 | rm -f /etc/update-motd.d/50-landscape-sysinfo 2>/dev/null || true |
214 | - /usr/sbin/update-motd 2>/dev/null || true |
215 | + update-motd 2>/dev/null || true |
216 | rm -f /etc/profile.d/landscape-sysinfo.sh 2>/dev/null || true |
217 | ;; |
218 | |
219 | |
220 | === modified file 'debian/rules' |
221 | --- debian/rules 2016-07-06 12:08:20 +0000 |
222 | +++ debian/rules 2017-01-18 09:59:00 +0000 |
223 | @@ -1,12 +1,6 @@ |
224 | #!/usr/bin/make -f |
225 | |
226 | dist_release := $(shell lsb_release -cs) |
227 | -ifneq ($(dist_release),dapper) |
228 | - use_pycentral = yes |
229 | -endif |
230 | -ifeq (,$(filter $(dist_release), hardy lucid)) |
231 | - use_dhpython2 = yes |
232 | -endif |
233 | |
234 | dh_extra_flags = -plandscape-common -plandscape-client |
235 | |
236 | @@ -92,19 +86,7 @@ |
237 | echo "extra:Depends=libpam-systemd" >> $(landscape_client_substvars) |
238 | endif |
239 | |
240 | -ifeq ($(use_dhpython2),yes) |
241 | dh_python2 --no-guessing-versions |
242 | -else |
243 | - ifeq ($(use_pycentral),yes) |
244 | - ifneq (,$(py_setup_install_args)) |
245 | - DH_PYCENTRAL=include-links dh_pycentral |
246 | - else |
247 | - DH_PYCENTRAL=nomove dh_pycentral |
248 | - endif |
249 | - else |
250 | - dh_python |
251 | - endif |
252 | -endif |
253 | dh_installdeb $(dh_extra_flags) |
254 | dh_gencontrol $(dh_extra_flags) |
255 | dh_md5sums $(dh_extra_flags) |
256 | |
257 | === modified file 'debian/source.lintian-overrides' |
258 | --- debian/source.lintian-overrides 2012-05-28 19:45:04 +0000 |
259 | +++ debian/source.lintian-overrides 2017-01-18 09:59:00 +0000 |
260 | @@ -1,15 +1,4 @@ |
261 | # we use dh_python or dh_python2 depending on the ubuntu release |
262 | # the package is being built on, this is detected dynamically |
263 | # in the rules file |
264 | -landscape-client source: dh_python-is-obsolete |
265 | - |
266 | -# the package has to build on lucid, where the standards version |
267 | -# is 3.8.2 |
268 | -landscape-client source: ancient-standards-version |
269 | - |
270 | -# it's a bug that should be fixed in quantal |
271 | -landscape-client source: unknown-field-in-dsc original-maintainer |
272 | - |
273 | -# this is only used in a very specific client upgrade from |
274 | -# the dbus to the amp version |
275 | -landscape-client: start-stop-daemon-in-maintainer-script postinst:130 |
276 | +landscape-client source: dh_python-is-obsolete |
277 | \ No newline at end of file |
278 | |
279 | === modified file 'dev/run-piuparts' |
280 | --- dev/run-piuparts 2014-10-29 11:18:17 +0000 |
281 | +++ dev/run-piuparts 2017-01-18 09:59:00 +0000 |
282 | @@ -24,17 +24,6 @@ |
283 | } |
284 | |
285 | # |
286 | -# Check if X is running, if not abort because we would make X crash (D-Bus!) |
287 | -# |
288 | -if pidof X > /dev/null; then |
289 | - cat <<EOF |
290 | -It appears you're running an X session. This script would kill your session |
291 | -due to landscape-client reloading dbus in its postinst script. Quitting now. |
292 | -EOF |
293 | - exit 1 |
294 | -fi |
295 | - |
296 | -# |
297 | # Check we have piuparts >= 0.36 |
298 | # |
299 | PIUPARTS_VERSION=$(sudo piuparts --version 2>/dev/null| cut -f 2 -d " ") |
300 | @@ -140,10 +129,7 @@ |
301 | -I "/var/lib/.*" \ |
302 | -I "/usr/lib/python2.6/dist-packages/twisted.*" \ |
303 | -i /etc/X11 \ |
304 | - -i /etc/dbus-1 \ |
305 | - -i /etc/dbus-1/system.d \ |
306 | -I "/usr/lib/python2.4/site-packages/apt.*" \ |
307 | - -I "/usr/lib/python2.4/site-packages/dbus.*" \ |
308 | -I "/usr/lib/python2.5/site-packages/twisted.*" \ |
309 | -b ${BASETGZ} \ |
310 | ${SOURCE}_${VERSION}_${ARCH}.changes |
311 | |
312 | === modified file 'landscape/broker/exchange.py' |
313 | --- landscape/broker/exchange.py 2015-01-12 09:27:02 +0000 |
314 | +++ landscape/broker/exchange.py 2017-01-18 09:59:00 +0000 |
315 | @@ -833,8 +833,7 @@ |
316 | handler(message) |
317 | |
318 | def register_client_accepted_message_type(self, type): |
319 | - # stringify the type because it's a dbus.String. It should work |
320 | - # anyway, but this is just for sanity and less confusing logs. |
321 | + # stringify the type for sanity and less confusing logs. |
322 | self._client_accepted_types.add(str(type)) |
323 | |
324 | def get_client_accepted_message_types(self): |
325 | |
326 | === removed file 'landscape/lib/bpickle_dbus.py' |
327 | --- landscape/lib/bpickle_dbus.py 2012-03-06 09:17:51 +0000 |
328 | +++ landscape/lib/bpickle_dbus.py 1970-01-01 00:00:00 +0000 |
329 | @@ -1,65 +0,0 @@ |
330 | -""" |
331 | -Different versions of the Python DBus bindings return different types |
332 | -to represent integers, strings, lists, etc. Older versions return |
333 | -builtin Python types: C{int}, C{str}, C{list}, etc. Newer versions |
334 | -return DBus-specific wrappers: C{Int16}, C{String}, C{Array}, etc. |
335 | -Failures occur when DBus types are used because bpickle doesn't know |
336 | -that an C{Int16} is really an C{int} and that an C{Array} is really a |
337 | -C{list}. |
338 | - |
339 | -L{install} and L{uninstall} can install and remove extensions that |
340 | -make bpickle work with DBus types. |
341 | -""" |
342 | - |
343 | -import dbus |
344 | - |
345 | -from landscape.lib import bpickle |
346 | - |
347 | - |
348 | -def install(): |
349 | - """Install bpickle extensions for DBus types.""" |
350 | - for type, function in get_dbus_types(): |
351 | - bpickle.dumps_table[type] = function |
352 | - |
353 | - |
354 | -def uninstall(): |
355 | - """Uninstall bpickle extensions for DBus types.""" |
356 | - for type, function in get_dbus_types(): |
357 | - del bpickle.dumps_table[type] |
358 | - |
359 | - |
360 | -def dumps_utf8string(obj): |
361 | - """ |
362 | - Convert the specified L{dbus.types.UTF8String} to bpickle's |
363 | - representation for C{unicode} data. |
364 | - """ |
365 | - return "u%s:%s" % (len(obj), obj) |
366 | - |
367 | - |
368 | -def dumps_double(obj): |
369 | - """ |
370 | - Convert a dbus.types.Double into a floating point representation. |
371 | - """ |
372 | - return "f%r;" % float(obj) |
373 | - |
374 | - |
375 | -def get_dbus_types(): |
376 | - """ |
377 | - Generator yields C{(type, bpickle_function)} for available DBus |
378 | - types. |
379 | - """ |
380 | - for (type_name, function) in [("Boolean", bpickle.dumps_bool), |
381 | - ("Int16", bpickle.dumps_int), |
382 | - ("UInt16", bpickle.dumps_int), |
383 | - ("Int32", bpickle.dumps_int), |
384 | - ("UInt32", bpickle.dumps_int), |
385 | - ("Int64", bpickle.dumps_int), |
386 | - ("UInt64", bpickle.dumps_int), |
387 | - ("Double", dumps_double), |
388 | - ("Array", bpickle.dumps_list), |
389 | - ("Dictionary", bpickle.dumps_dict), |
390 | - ("String", bpickle.dumps_unicode), |
391 | - ("UTF8String", dumps_utf8string)]: |
392 | - type = getattr(dbus.types, type_name, None) |
393 | - if type is not None: |
394 | - yield type, function |
395 | |
396 | === modified file 'landscape/service.py' |
397 | --- landscape/service.py 2013-05-14 22:57:15 +0000 |
398 | +++ landscape/service.py 2017-01-18 09:59:00 +0000 |
399 | @@ -27,12 +27,6 @@ |
400 | |
401 | def __init__(self, config): |
402 | self.config = config |
403 | - try: |
404 | - from landscape.lib import bpickle_dbus |
405 | - except ImportError: |
406 | - pass |
407 | - else: |
408 | - bpickle_dbus.install() |
409 | self.reactor = self.reactor_factory() |
410 | if self.persist_filename: |
411 | self.persist = get_versioned_persist(self) |
412 | |
413 | === modified file 'landscape/tests/test_service.py' |
414 | --- landscape/tests/test_service.py 2016-08-17 20:31:48 +0000 |
415 | +++ landscape/tests/test_service.py 2017-01-18 09:59:00 +0000 |
416 | @@ -1,6 +1,5 @@ |
417 | import logging |
418 | import signal |
419 | -import mock |
420 | |
421 | from twisted.internet import reactor |
422 | from twisted.internet.task import deferLater |
423 | @@ -53,14 +52,6 @@ |
424 | service = TestService(self.config) |
425 | self.assertFalse(hasattr(service, "persist")) |
426 | |
427 | - @mock.patch("landscape.lib.bpickle_dbus.install") |
428 | - def test_install_bpickle_dbus(self, mock_install): |
429 | - """ |
430 | - A L{LandscapeService} installs the DBus extensions of bpickle. |
431 | - """ |
432 | - TestService(self.config) |
433 | - mock_install.assert_called_once_with() |
434 | - |
435 | def test_usr1_rotates_logs(self): |
436 | """ |
437 | SIGUSR1 should cause logs to be reopened. |
438 | |
439 | === removed file 'landscape/tests/test_textmessage.py' |
440 | --- landscape/tests/test_textmessage.py 2012-03-05 14:11:42 +0000 |
441 | +++ landscape/tests/test_textmessage.py 1970-01-01 00:00:00 +0000 |
442 | @@ -1,112 +0,0 @@ |
443 | -import sys |
444 | - |
445 | -from landscape.textmessage import ( |
446 | - AcceptedTypeError, EmptyMessageError, got_accepted_types, get_message, |
447 | - send_message) |
448 | -from landscape.tests.helpers import ( |
449 | - LandscapeTest, FakeBrokerServiceHelper, StandardIOHelper) |
450 | - |
451 | - |
452 | -class SendMessageTest(LandscapeTest): |
453 | - |
454 | - helpers = [StandardIOHelper, FakeBrokerServiceHelper] |
455 | - |
456 | - def test_send_message(self): |
457 | - """ |
458 | - L{send_message} should send a message of type |
459 | - C{text-message} to the landscape dbus messaging service. |
460 | - """ |
461 | - service = self.broker_service |
462 | - service.message_store.set_accepted_types(["text-message"]) |
463 | - |
464 | - result = send_message(u"Hi there!", self.remote) |
465 | - |
466 | - def got_result(result): |
467 | - messages = service.message_store.get_pending_messages() |
468 | - self.assertEqual(len(messages), 1) |
469 | - self.assertMessage(messages[0], {"type": "text-message", |
470 | - "message": u"Hi there!"}) |
471 | - self.assertTrue(service.exchanger.is_urgent()) |
472 | - return result.addCallback(got_result) |
473 | - |
474 | - def test_got_accepted_types_without_text_message_type(self): |
475 | - """ |
476 | - If 'text-message' isn't in the list of accepted types an |
477 | - L{AcceptedTypeError} is raised. |
478 | - """ |
479 | - self.assertRaises(AcceptedTypeError, got_accepted_types, (), |
480 | - self.remote, ()) |
481 | - |
482 | - def test_got_accepted_types(self): |
483 | - """ |
484 | - If 'text-message' is an accepted type a message should be |
485 | - retrieved from the user and sent to the broker. |
486 | - """ |
487 | - service = self.broker_service |
488 | - service.message_store.set_accepted_types(["text-message"]) |
489 | - |
490 | - input = u"Foobl\N{HIRAGANA LETTER A}" |
491 | - self.stdin.write(input.encode("UTF-8")) |
492 | - self.stdin.seek(0, 0) |
493 | - |
494 | - def got_result(result): |
495 | - messages = service.message_store.get_pending_messages() |
496 | - self.assertEqual(len(messages), 1) |
497 | - self.assertMessage(messages[0], |
498 | - {"type": "text-message", |
499 | - "message": u"Foobl\N{HIRAGANA LETTER A}"}) |
500 | - |
501 | - d = got_accepted_types(["text-message"], self.remote, ()) |
502 | - d.addCallback(got_result) |
503 | - return d |
504 | - |
505 | - |
506 | -class ScriptTest(LandscapeTest): |
507 | - |
508 | - helpers = [StandardIOHelper] |
509 | - |
510 | - def test_get_message(self): |
511 | - """ |
512 | - A message should be properly decoded from the command line arguments. |
513 | - """ |
514 | - message = get_message( |
515 | - ["landscape-message", |
516 | - u"\N{HIRAGANA LETTER A}".encode(sys.stdin.encoding), "a!"]) |
517 | - self.assertEqual(message, u"\N{HIRAGANA LETTER A} a!") |
518 | - |
519 | - def test_get_message_stdin(self): |
520 | - """ |
521 | - If no arguments are specified then the message should be read |
522 | - from stdin. |
523 | - """ |
524 | - input = u"Foobl\N{HIRAGANA LETTER A}" |
525 | - self.stdin.write(input.encode("UTF-8")) |
526 | - self.stdin.seek(0, 0) |
527 | - message = get_message(["landscape-message"]) |
528 | - self.assertEqual(self.stdout.getvalue(), |
529 | - "Please enter your message, and send EOF " |
530 | - "(Control + D after newline) when done.\n") |
531 | - self.assertEqual(message, input) |
532 | - |
533 | - def test_get_empty_message_stdin(self): |
534 | - """ |
535 | - If no arguments are specified then the message should be read |
536 | - from stdin. |
537 | - """ |
538 | - self.assertRaises(EmptyMessageError, |
539 | - get_message, ["landscape-message"]) |
540 | - |
541 | - def test_get_message_without_encoding(self): |
542 | - """ |
543 | - If sys.stdin.encoding is None, it's likely a pipe, so try to |
544 | - decode it as UTF-8 by default. |
545 | - """ |
546 | - encoding = sys.stdin.encoding |
547 | - sys.stdin.encoding = None |
548 | - try: |
549 | - message = get_message( |
550 | - ["landscape-message", |
551 | - u"\N{HIRAGANA LETTER A}".encode("UTF-8"), "a!"]) |
552 | - finally: |
553 | - sys.stdin.encoding = encoding |
554 | - self.assertEqual(message, u"\N{HIRAGANA LETTER A} a!") |
555 | |
556 | === removed file 'landscape/textmessage.py' |
557 | --- landscape/textmessage.py 2013-05-21 08:37:08 +0000 |
558 | +++ landscape/textmessage.py 1970-01-01 00:00:00 +0000 |
559 | @@ -1,103 +0,0 @@ |
560 | -""" |
561 | -Support code for the C{landscape-message} utility, which sends a text |
562 | -message to the Landscape web UI via the landscape-client's dbus |
563 | -messaging service (see L{landscape.plugins.dbus_message}). |
564 | -""" |
565 | - |
566 | -import sys |
567 | - |
568 | -from landscape.lib.log import log_failure |
569 | -from landscape.reactor import LandscapeReactor |
570 | -from landscape.broker.amp import RemoteBrokerConnector |
571 | -from landscape.deployment import Configuration |
572 | - |
573 | - |
574 | -class AcceptedTypeError(Exception): |
575 | - """ |
576 | - Raised when a message is sent without 'text-message' being an |
577 | - accepted type. |
578 | - """ |
579 | - |
580 | - |
581 | -class EmptyMessageError(Exception): |
582 | - """Raised when an empty message is provied.""" |
583 | - |
584 | - |
585 | -def send_message(text, broker): |
586 | - """Add a message to the queue via a remote broker. |
587 | - |
588 | - The message is of type C{text-message}. |
589 | - |
590 | - @param broker: A connected L{RemoteBroker} object to use to send |
591 | - the message. |
592 | - @return: A L{Deferred} which will fire with the result of the send. |
593 | - """ |
594 | - def got_session_id(session_id): |
595 | - response = broker.send_message(message, session_id, True) |
596 | - return response |
597 | - |
598 | - message = {"type": "text-message", "message": text} |
599 | - result = broker.get_session_id() |
600 | - result.addCallback(got_session_id) |
601 | - return result |
602 | - |
603 | - |
604 | -def got_result(result): |
605 | - print u"Message sent." |
606 | - |
607 | - |
608 | -def get_message(args): |
609 | - encoding = sys.stdin.encoding or "UTF-8" |
610 | - if len(args) < 2: |
611 | - print ("Please enter your message, and send EOF (Control + D after " |
612 | - "newline) when done.") |
613 | - message = sys.stdin.read().decode(encoding) |
614 | - else: |
615 | - message = u" ".join([x.decode(encoding) for x in args[1:]]) |
616 | - if not message: |
617 | - raise EmptyMessageError("Text messages may not be empty.") |
618 | - return message |
619 | - |
620 | - |
621 | -def got_accepted_types(accepted_types, broker, args): |
622 | - if not "text-message" in accepted_types: |
623 | - raise AcceptedTypeError("Text messages may not be created. Is " |
624 | - "Landscape Client registered with the server?") |
625 | - message = get_message(args) |
626 | - d = send_message(message, broker) |
627 | - d.addCallback(got_result) |
628 | - return d |
629 | - |
630 | - |
631 | -def run(args=sys.argv): |
632 | - """Send a message to Landscape. |
633 | - |
634 | - This function runs a Twisted reactor, prints various status |
635 | - messages, and exits the process. |
636 | - """ |
637 | - reactor = LandscapeReactor() |
638 | - config = Configuration() |
639 | - config.load(args) |
640 | - |
641 | - def got_connection(broker): |
642 | - result = broker.get_accepted_message_types() |
643 | - return result.addCallback(got_accepted_types, broker, args) |
644 | - |
645 | - def got_error(failure): |
646 | - log_failure(failure) |
647 | - |
648 | - connector = RemoteBrokerConnector(reactor, config) |
649 | - result = connector.connect() |
650 | - result.addCallback(got_connection) |
651 | - result.addErrback(got_error) |
652 | - result.addBoth(lambda x: connector.disconnect()) |
653 | - |
654 | - # For some obscure reason our LandscapeReactor.stop method calls |
655 | - # reactor.crash() instead of reactor.stop(), which doesn't work |
656 | - # here. Maybe LandscapeReactor.stop should simply use reactor.stop(). |
657 | - result.addBoth(lambda ignored: reactor.call_later( |
658 | - 0, reactor._reactor.stop)) |
659 | - |
660 | - reactor.run() |
661 | - |
662 | - return result |
663 | |
664 | === modified file 'landscape/watchdog.py' |
665 | --- landscape/watchdog.py 2014-07-10 19:16:56 +0000 |
666 | +++ landscape/watchdog.py 2017-01-18 09:59:00 +0000 |
667 | @@ -58,8 +58,6 @@ |
668 | @cvar program: The name of the executable program that will start this |
669 | daemon. |
670 | @cvar username: The name of the user to switch to, by default. |
671 | - @cvar service: The DBus service name that the program will be expected to |
672 | - listen on. |
673 | @cvar max_retries: The maximum number of retries before giving up when |
674 | trying to connect to the watched daemon. |
675 | @cvar factor: The factor by which the delay between subsequent connection |
676 | @@ -184,7 +182,7 @@ |
677 | def is_running(self): |
678 | # FIXME Error cases may not be handled in the best possible way |
679 | # here. We're basically return False if any error happens from the |
680 | - # dbus ping. |
681 | + # AMP ping. |
682 | return self._connect_and_call("ping") |
683 | |
684 | def wait(self): |
685 | @@ -375,7 +373,7 @@ |
686 | def start(self): |
687 | """ |
688 | Start all daemons. The broker will be started first, and no other |
689 | - daemons will be started before it is running and responding to DBUS |
690 | + daemons will be started before it is running and responding to AMP |
691 | messages. |
692 | |
693 | @return: A deferred which fires when all services have successfully |
694 | |
695 | === modified file 'man/landscape-client.1' |
696 | --- man/landscape-client.1 2014-07-10 19:16:56 +0000 |
697 | +++ man/landscape-client.1 2017-01-18 09:59:00 +0000 |
698 | @@ -1,5 +1,5 @@ |
699 | -.\"Text automatically generated by txt2man |
700 | -.TH landscape-client 1 "10 July 2014" "" "" |
701 | +.\" Text automatically generated by txt2man |
702 | +.TH landscape-client 1 "05 January 2017" "" "" |
703 | .SH NAME |
704 | \fBlandscape-client \fP- Landscape system client |
705 | \fB |
706 | @@ -33,12 +33,12 @@ |
707 | \fB-c\fP FILE, \fB--config\fP=FILE |
708 | Use config from this file (any command line |
709 | \fIoptions\fP override settings from the file). (default: |
710 | -'/etc/landscape/client.conf') |
711 | +\(cq/etc/landscape/client.conf') |
712 | .TP |
713 | .B |
714 | \fB-d\fP PATH, \fB--data-path\fP=PATH |
715 | The directory to store data files in (default: |
716 | -'/var/lib/landscape/client/'). |
717 | +\(cq/var/lib/landscape/client/'). |
718 | .TP |
719 | .B |
720 | \fB-q\fP, \fB--quiet\fP |
721 | @@ -47,7 +47,7 @@ |
722 | .B |
723 | \fB-l\fP FILE, \fB--log-dir\fP=FILE |
724 | The directory to write log files to (default: |
725 | -'/var/log/landscape'). |
726 | +\(cq/var/log/landscape'). |
727 | .TP |
728 | .B |
729 | \fB--log-level\fP=LOG_LEVEL |
730 | |
731 | === modified file 'man/landscape-config.1' |
732 | --- man/landscape-config.1 2014-07-10 19:16:56 +0000 |
733 | +++ man/landscape-config.1 2017-01-18 09:59:00 +0000 |
734 | @@ -1,5 +1,5 @@ |
735 | -.\"Text automatically generated by txt2man |
736 | -.TH landscape-config 1 "10 July 2014" "" "" |
737 | +.\" Text automatically generated by txt2man |
738 | +.TH landscape-config 1 "05 January 2017" "" "" |
739 | .SH NAME |
740 | \fBlandscape-config \fP- configure the Landscape management client |
741 | \fB |
742 | |
743 | === removed file 'man/landscape-message.1' |
744 | --- man/landscape-message.1 2014-07-10 19:16:56 +0000 |
745 | +++ man/landscape-message.1 1970-01-01 00:00:00 +0000 |
746 | @@ -1,51 +0,0 @@ |
747 | -.\"Text automatically generated by txt2man |
748 | -.TH landscape-message 1 "10 July 2014" "" "" |
749 | -.SH NAME |
750 | -\fBlandscape-message \fP- Send a message to the landscape web interface |
751 | -\fB |
752 | -.SH SYNOPSIS |
753 | -.nf |
754 | -.fam C |
755 | -\fBlandscape-message\fP [\fIoptions\fP] [\fIMESSAGE\fP] \.\.\. |
756 | - |
757 | -.fam T |
758 | -.fi |
759 | -.fam T |
760 | -.fi |
761 | -.SH DESCRIPTION |
762 | - |
763 | -Invoking \fBlandscape-message\fP will cause a message to appear in the |
764 | -History section for this computer in the Landscape web UI. |
765 | -.PP |
766 | -If no \fIMESSAGE\fP is specified on the command line, then \fBlandscape-message\fP |
767 | -will read the message from STDIN until EOF. |
768 | -.RE |
769 | -.PP |
770 | - |
771 | -.SH OPTIONS |
772 | -.TP |
773 | -.B |
774 | -\fB--version\fP |
775 | -Show program's version number and exit. |
776 | -.TP |
777 | -.B |
778 | -\fB-h\fP, \fB--help\fP |
779 | -Show this help message and exit. |
780 | -.TP |
781 | -.B |
782 | -\fB-b\fP BUS, \fB--bus\fP=BUS |
783 | -The DBUS bus to use to send the message. |
784 | -.SH EXAMPLES |
785 | - |
786 | -\fBlandscape-message\fP Hello administrator |
787 | -.RE |
788 | -.PP |
789 | - |
790 | -.SH SEE ALSO |
791 | - |
792 | -landscape-client (1) |
793 | -.RE |
794 | -.PP |
795 | - |
796 | -.SH AUTHOR |
797 | -Landscape Development Team <landscape-team@canonical.com> |
798 | |
799 | === removed file 'man/landscape-message.txt' |
800 | --- man/landscape-message.txt 2012-03-05 14:11:42 +0000 |
801 | +++ man/landscape-message.txt 1970-01-01 00:00:00 +0000 |
802 | @@ -1,32 +0,0 @@ |
803 | -NAME |
804 | - landscape-message - Send a message to the landscape web interface |
805 | - |
806 | -SYNOPSIS |
807 | - landscape-message [options] [MESSAGE] ... |
808 | - |
809 | -DESCRIPTION |
810 | - |
811 | -Invoking landscape-message will cause a message to appear in the |
812 | -History section for this computer in the Landscape web UI. |
813 | - |
814 | -If no MESSAGE is specified on the command line, then landscape-message |
815 | -will read the message from STDIN until EOF. |
816 | - |
817 | - |
818 | -OPTIONS |
819 | - --version Show program's version number and exit. |
820 | - -h, --help Show this help message and exit. |
821 | - -b BUS, --bus=BUS The DBUS bus to use to send the message. |
822 | - |
823 | -EXAMPLES |
824 | - |
825 | - landscape-message Hello administrator |
826 | - |
827 | - |
828 | -SEE ALSO |
829 | - |
830 | - landscape-client (1) |
831 | - |
832 | - |
833 | -AUTHOR |
834 | - Landscape Development Team <landscape-team@canonical.com> |
835 | |
836 | === modified file 'man/landscape-sysinfo.1' |
837 | --- man/landscape-sysinfo.1 2014-07-10 19:16:56 +0000 |
838 | +++ man/landscape-sysinfo.1 2017-01-18 09:59:00 +0000 |
839 | @@ -1,5 +1,5 @@ |
840 | -.\"Text automatically generated by txt2man |
841 | -.TH landscape-sysinfo 1 "10 July 2014" "" "" |
842 | +.\" Text automatically generated by txt2man |
843 | +.TH landscape-sysinfo 1 "05 January 2017" "" "" |
844 | .SH NAME |
845 | \fBlandscape-sysinfo \fP- Display a summary of the current system status |
846 | \fB |
847 | |
848 | === removed file 'scripts/landscape-dbus-proxy' |
849 | --- scripts/landscape-dbus-proxy 2013-06-03 07:23:35 +0000 |
850 | +++ scripts/landscape-dbus-proxy 1970-01-01 00:00:00 +0000 |
851 | @@ -1,91 +0,0 @@ |
852 | -#!/usr/bin/env python |
853 | -""" |
854 | -This script is needed in case the client is upgrading from a pre-AMP version |
855 | -using Dbus as the messaging mechanism (like the landscape-client package from |
856 | -the lucid archives). |
857 | -This allows the package changer to send package changes to the broker using |
858 | -Dbus. |
859 | - |
860 | -This will only be run for old packages depending on DBus, we don't need to |
861 | -depend on DBus in the current version. |
862 | -""" |
863 | - |
864 | -import os |
865 | -import dbus |
866 | -import dbus.service |
867 | -import dbus.glib # This as side effects, don't remove it! |
868 | - |
869 | -from dbus.service import Object, BusName, method |
870 | - |
871 | -from twisted.internet import glib2reactor |
872 | -glib2reactor.install() |
873 | -from twisted.internet import reactor |
874 | - |
875 | -from landscape.lib.bpickle import loads |
876 | -from landscape.lib.lock import lock_path, LockError |
877 | -from landscape.reactor import LandscapeReactor |
878 | -from landscape.deployment import Configuration |
879 | -from landscape.broker.amp import RemoteBrokerConnector |
880 | - |
881 | - |
882 | -BUS_NAME = "com.canonical.landscape.Broker" |
883 | -OBJECT_PATH = "/com/canonical/landscape/Broker" |
884 | - |
885 | - |
886 | -def array_to_string(array): |
887 | - """Convert an L{Array} of L{Byte}s (or integers) to a Python str.""" |
888 | - result = [] |
889 | - for item in array: |
890 | - if item < 0: |
891 | - item = item + 256 |
892 | - result.append(chr(item)) |
893 | - return "".join(result) |
894 | - |
895 | - |
896 | -class BrokerDBusObject(Object): |
897 | - """A DBus-published object proxying L{RemoteBroker.send_message}. |
898 | - |
899 | - It is used when upgrading from a DBus-based version of the Landscape client |
900 | - to the newer AMP-based one, for letting the old package-changer process |
901 | - performing the upgrade communicate with the new version of the client. |
902 | - """ |
903 | - bus_name = BUS_NAME |
904 | - object_path = OBJECT_PATH |
905 | - |
906 | - def __init__(self, config): |
907 | - super(BrokerDBusObject, self).__init__(BusName( |
908 | - self.bus_name, dbus.SystemBus()), object_path=self.object_path) |
909 | - self.config = config |
910 | - |
911 | - @method(BUS_NAME) |
912 | - def send_message(self, message, urgent=True): |
913 | - """Queue the given message in the message exchange.""" |
914 | - message = loads(array_to_string(message)) |
915 | - |
916 | - def cb_connected(broker): |
917 | - result = broker.send_message(message, urgent=True) |
918 | - return result.addCallback(cb_done) |
919 | - |
920 | - def cb_done(ignored): |
921 | - return reactor.stop() |
922 | - |
923 | - landscape_reactor = LandscapeReactor() |
924 | - connector = RemoteBrokerConnector(landscape_reactor, self.config) |
925 | - connected = connector.connect() |
926 | - connected.addCallback(cb_connected) |
927 | - |
928 | - |
929 | -if __name__ == "__main__": |
930 | - config = Configuration() |
931 | - lock_dir = os.path.join(config.data_path, "package") |
932 | - if os.path.isdir(lock_dir): |
933 | - lock_filename = os.path.join(lock_dir, "changer.lock") |
934 | - try: |
935 | - lock_path(lock_filename) |
936 | - except LockError: |
937 | - # The package-changer is running, this means that we're upgrading from |
938 | - # a non-AMP version and that the upgrade is Landscape driven, so let's |
939 | - # expose the DBus broker proxy to give a chance to the package-changer |
940 | - # to send its result message. |
941 | - remote = BrokerDBusObject(config) |
942 | - reactor.run() |
943 | |
944 | === removed file 'scripts/landscape-message' |
945 | --- scripts/landscape-message 2008-09-08 17:49:13 +0000 |
946 | +++ scripts/landscape-message 1970-01-01 00:00:00 +0000 |
947 | @@ -1,8 +0,0 @@ |
948 | -#!/usr/bin/python |
949 | -import sys, os |
950 | -if os.path.dirname(os.path.abspath(sys.argv[0])) == os.path.abspath("scripts"): |
951 | - sys.path.insert(0, "./") |
952 | - |
953 | -from landscape.textmessage import run |
954 | - |
955 | -run() |
956 | |
957 | === modified file 'setup.py' |
958 | --- setup.py 2016-01-07 10:45:00 +0000 |
959 | +++ setup.py 2017-01-18 09:59:00 +0000 |
960 | @@ -22,18 +22,14 @@ |
961 | "landscape.upgraders", |
962 | "landscape.user", |
963 | "landscape.lib"], |
964 | - data_files=[ |
965 | - ("/etc/dbus-1/system.d/", ["dbus-1/landscape.conf"])], |
966 | scripts=["scripts/landscape-client", |
967 | "scripts/landscape-config", |
968 | - "scripts/landscape-message", |
969 | "scripts/landscape-broker", |
970 | "scripts/landscape-manager", |
971 | "scripts/landscape-monitor", |
972 | "scripts/landscape-package-changer", |
973 | "scripts/landscape-package-reporter", |
974 | "scripts/landscape-release-upgrader", |
975 | - "scripts/landscape-sysinfo", |
976 | - "scripts/landscape-dbus-proxy"], |
977 | + "scripts/landscape-sysinfo"], |
978 | cmdclass={"build": build_extra.build_extra, |
979 | "clean": clean_build_tree}) |
Command: TRIAL_ARGS=-j4 make check /ci.lscape. net/job/ latch-test- precise/ 855/
Result: Success
Revno: 928
Branch: lp:~adam-collard/landscape-client/drop-dbus
Jenkins: https:/