Merge lp:~andreserl/maas/lp1553791 into lp:~maas-maintainers/maas/packaging

Proposed by Andres Rodriguez on 2016-03-07
Status: Merged
Approved by: Andres Rodriguez on 2016-03-07
Approved revision: 452
Merged at revision: 452
Proposed branch: lp:~andreserl/maas/lp1553791
Merge into: lp:~maas-maintainers/maas/packaging
Diff against target: 275 lines (+130/-107)
5 files modified
debian/changelog (+2/-0)
debian/extras/maas-provision (+6/-51)
debian/extras/maas-rack (+55/-0)
debian/extras/maas-region (+62/-0)
debian/extras/maas-region-admin (+5/-56)
To merge this branch: bzr merge lp:~andreserl/maas/lp1553791
Reviewer Review Type Date Requested Status
Blake Rouse (community) 2016-03-07 Approve on 2016-03-07
Review via email: mp+288296@code.launchpad.net

Commit message

Change maas-provision,maas-region-admin to maas-rack,maas-region respectively

To post a comment you must log in.
Blake Rouse (blake-rouse) wrote :

Looks good. The maas source needs to be updated as well, that way the development environment matches the packaging.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2016-03-06 16:54:54 +0000
3+++ debian/changelog 2016-03-07 14:26:11 +0000
4@@ -12,6 +12,8 @@
5 * Allow 'dhcpd' to access /usr/sbin/maas-provision via
6 sudoers file (LP: #1552775)
7 * debian/extras/maas: Replace shell wrapper with python. (LP: #1553605)
8+ * debian/extras/maas-{region,rack}: Replace maas-region-admin
9+ and maas-provision, respectively (LP: #1553791)
10 * debian/control: Depends on iproute2 instead. (LP: #1553647)
11
12 -- Andres Rodriguez <andreserl@ubuntu.com> Mon, 01 Feb 2016 18:18:52 +0100
13
14=== modified file 'debian/extras/maas-provision'
15--- debian/extras/maas-provision 2015-12-09 02:18:13 +0000
16+++ debian/extras/maas-provision 2016-03-07 14:26:11 +0000
17@@ -2,54 +2,9 @@
18 # Copyright 2015 Canonical Ltd. This software is licensed under the
19 # GNU Affero General Public License version 3 (see the file LICENSE).
20
21-from __future__ import (
22- absolute_import,
23- print_function,
24- unicode_literals,
25-)
26-
27-str = None
28-
29-__metaclass__ = type
30-__all__ = []
31-
32-import grp
33-import os
34-
35-
36-def check_user():
37- # At present, only root should execute this.
38- if os.getuid() != 0:
39- raise SystemExit("This utility may only be run as root.")
40-
41-
42-def set_group():
43- # Ensure that we're running as the `maas` group.
44- try:
45- gr_maas = grp.getgrnam("maas")
46- except KeyError:
47- raise SystemExit("No such group: maas")
48- else:
49- os.setegid(gr_maas.gr_gid)
50-
51-
52-def set_umask():
53- # Prevent creation of world-readable (or writable, executable) files.
54- os.umask(0o007)
55-
56-
57-def run():
58- # Run the main provisioning script.
59- from provisioningserver.__main__ import main
60- main()
61-
62-
63-def main():
64- check_user()
65- set_group()
66- set_umask()
67- run()
68-
69-
70-if __name__ == "__main__":
71- main()
72+import sys
73+
74+sys.stderr.write("""
75+ WARNING: The maas-provision command is deprecated and will be removed in a future
76+ version. From now on please use 'maas-rack' instead.
77+""")
78
79=== added file 'debian/extras/maas-rack'
80--- debian/extras/maas-rack 1970-01-01 00:00:00 +0000
81+++ debian/extras/maas-rack 2016-03-07 14:26:11 +0000
82@@ -0,0 +1,55 @@
83+#!/usr/bin/python3
84+# Copyright 2015 Canonical Ltd. This software is licensed under the
85+# GNU Affero General Public License version 3 (see the file LICENSE).
86+
87+from __future__ import (
88+ absolute_import,
89+ print_function,
90+ unicode_literals,
91+)
92+
93+str = None
94+
95+__metaclass__ = type
96+__all__ = []
97+
98+import grp
99+import os
100+
101+
102+def check_user():
103+ # At present, only root should execute this.
104+ if os.getuid() != 0:
105+ raise SystemExit("This utility may only be run as root.")
106+
107+
108+def set_group():
109+ # Ensure that we're running as the `maas` group.
110+ try:
111+ gr_maas = grp.getgrnam("maas")
112+ except KeyError:
113+ raise SystemExit("No such group: maas")
114+ else:
115+ os.setegid(gr_maas.gr_gid)
116+
117+
118+def set_umask():
119+ # Prevent creation of world-readable (or writable, executable) files.
120+ os.umask(0o007)
121+
122+
123+def run():
124+ # Run the main provisioning script.
125+ from provisioningserver.__main__ import main
126+ main()
127+
128+
129+def main():
130+ check_user()
131+ set_group()
132+ set_umask()
133+ run()
134+
135+
136+if __name__ == "__main__":
137+ main()
138
139=== added file 'debian/extras/maas-region'
140--- debian/extras/maas-region 1970-01-01 00:00:00 +0000
141+++ debian/extras/maas-region 2016-03-07 14:26:11 +0000
142@@ -0,0 +1,62 @@
143+#!/usr/bin/python3
144+# Copyright 2015 Canonical Ltd. This software is licensed under the
145+# GNU Affero General Public License version 3 (see the file LICENSE).
146+
147+from __future__ import (
148+ absolute_import,
149+ print_function,
150+ unicode_literals,
151+)
152+
153+str = None
154+
155+__metaclass__ = type
156+__all__ = []
157+
158+import grp
159+import os
160+import sys
161+
162+
163+def check_user():
164+ # At present, only root should execute this.
165+ if os.getuid() != 0:
166+ raise SystemExit("This utility may only be run as root.")
167+
168+
169+def set_group():
170+ # Ensure that we're running as the `maas` group.
171+ try:
172+ gr_maas = grp.getgrnam("maas")
173+ except KeyError:
174+ raise SystemExit("No such group: maas")
175+ else:
176+ os.setegid(gr_maas.gr_gid)
177+
178+
179+def set_umask():
180+ # Prevent creation of world-readable (or writable, executable) files.
181+ os.umask(0o007)
182+
183+
184+def run():
185+ # Force the production MAAS Django configuration.
186+ os.environ.setdefault("DJANGO_SETTINGS_MODULE", "maas.settings")
187+
188+ # The Django configuration lives outside of sys.path.
189+ sys.path.append('/usr/share/maas')
190+
191+ # Let Django do the rest.
192+ from django.core import management
193+ management.execute_from_command_line()
194+
195+
196+def main():
197+ check_user()
198+ set_group()
199+ set_umask()
200+ run()
201+
202+
203+if __name__ == "__main__":
204+ main()
205
206=== modified file 'debian/extras/maas-region-admin'
207--- debian/extras/maas-region-admin 2015-12-09 02:18:13 +0000
208+++ debian/extras/maas-region-admin 2016-03-07 14:26:11 +0000
209@@ -2,61 +2,10 @@
210 # Copyright 2015 Canonical Ltd. This software is licensed under the
211 # GNU Affero General Public License version 3 (see the file LICENSE).
212
213-from __future__ import (
214- absolute_import,
215- print_function,
216- unicode_literals,
217-)
218-
219-str = None
220-
221-__metaclass__ = type
222-__all__ = []
223-
224-import grp
225-import os
226 import sys
227
228-
229-def check_user():
230- # At present, only root should execute this.
231- if os.getuid() != 0:
232- raise SystemExit("This utility may only be run as root.")
233-
234-
235-def set_group():
236- # Ensure that we're running as the `maas` group.
237- try:
238- gr_maas = grp.getgrnam("maas")
239- except KeyError:
240- raise SystemExit("No such group: maas")
241- else:
242- os.setegid(gr_maas.gr_gid)
243-
244-
245-def set_umask():
246- # Prevent creation of world-readable (or writable, executable) files.
247- os.umask(0o007)
248-
249-
250-def run():
251- # Force the production MAAS Django configuration.
252- os.environ.setdefault("DJANGO_SETTINGS_MODULE", "maas.settings")
253-
254- # The Django configuration lives outside of sys.path.
255- sys.path.append('/usr/share/maas')
256-
257- # Let Django do the rest.
258- from django.core import management
259- management.execute_from_command_line()
260-
261-
262-def main():
263- check_user()
264- set_group()
265- set_umask()
266- run()
267-
268-
269-if __name__ == "__main__":
270- main()
271+sys.stderr.write("""
272+ WARNING: The maas-region-admin command is deprecated and will be removed in a future
273+ version. From now on please use 'maas-region' instead.
274+""")
275+

Subscribers

People subscribed via source and target branches

to all changes: