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