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

Proposed by Andres Rodriguez
Status: Merged
Approved by: Andres Rodriguez
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) Approve
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.
Revision history for this message
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
=== modified file 'debian/changelog'
--- debian/changelog 2016-03-06 16:54:54 +0000
+++ debian/changelog 2016-03-07 14:26:11 +0000
@@ -12,6 +12,8 @@
12 * Allow 'dhcpd' to access /usr/sbin/maas-provision via12 * Allow 'dhcpd' to access /usr/sbin/maas-provision via
13 sudoers file (LP: #1552775)13 sudoers file (LP: #1552775)
14 * debian/extras/maas: Replace shell wrapper with python. (LP: #1553605)14 * debian/extras/maas: Replace shell wrapper with python. (LP: #1553605)
15 * debian/extras/maas-{region,rack}: Replace maas-region-admin
16 and maas-provision, respectively (LP: #1553791)
15 * debian/control: Depends on iproute2 instead. (LP: #1553647)17 * debian/control: Depends on iproute2 instead. (LP: #1553647)
1618
17 -- Andres Rodriguez <andreserl@ubuntu.com> Mon, 01 Feb 2016 18:18:52 +010019 -- Andres Rodriguez <andreserl@ubuntu.com> Mon, 01 Feb 2016 18:18:52 +0100
1820
=== modified file 'debian/extras/maas-provision'
--- debian/extras/maas-provision 2015-12-09 02:18:13 +0000
+++ debian/extras/maas-provision 2016-03-07 14:26:11 +0000
@@ -2,54 +2,9 @@
2# Copyright 2015 Canonical Ltd. This software is licensed under the2# Copyright 2015 Canonical Ltd. This software is licensed under the
3# GNU Affero General Public License version 3 (see the file LICENSE).3# GNU Affero General Public License version 3 (see the file LICENSE).
44
5from __future__ import (5import sys
6 absolute_import,6
7 print_function,7sys.stderr.write("""
8 unicode_literals,8 WARNING: The maas-provision command is deprecated and will be removed in a future
9)9 version. From now on please use 'maas-rack' instead.
1010""")
11str = None
12
13__metaclass__ = type
14__all__ = []
15
16import grp
17import os
18
19
20def check_user():
21 # At present, only root should execute this.
22 if os.getuid() != 0:
23 raise SystemExit("This utility may only be run as root.")
24
25
26def set_group():
27 # Ensure that we're running as the `maas` group.
28 try:
29 gr_maas = grp.getgrnam("maas")
30 except KeyError:
31 raise SystemExit("No such group: maas")
32 else:
33 os.setegid(gr_maas.gr_gid)
34
35
36def set_umask():
37 # Prevent creation of world-readable (or writable, executable) files.
38 os.umask(0o007)
39
40
41def run():
42 # Run the main provisioning script.
43 from provisioningserver.__main__ import main
44 main()
45
46
47def main():
48 check_user()
49 set_group()
50 set_umask()
51 run()
52
53
54if __name__ == "__main__":
55 main()
5611
=== added file 'debian/extras/maas-rack'
--- debian/extras/maas-rack 1970-01-01 00:00:00 +0000
+++ debian/extras/maas-rack 2016-03-07 14:26:11 +0000
@@ -0,0 +1,55 @@
1#!/usr/bin/python3
2# Copyright 2015 Canonical Ltd. This software is licensed under the
3# GNU Affero General Public License version 3 (see the file LICENSE).
4
5from __future__ import (
6 absolute_import,
7 print_function,
8 unicode_literals,
9)
10
11str = None
12
13__metaclass__ = type
14__all__ = []
15
16import grp
17import os
18
19
20def check_user():
21 # At present, only root should execute this.
22 if os.getuid() != 0:
23 raise SystemExit("This utility may only be run as root.")
24
25
26def set_group():
27 # Ensure that we're running as the `maas` group.
28 try:
29 gr_maas = grp.getgrnam("maas")
30 except KeyError:
31 raise SystemExit("No such group: maas")
32 else:
33 os.setegid(gr_maas.gr_gid)
34
35
36def set_umask():
37 # Prevent creation of world-readable (or writable, executable) files.
38 os.umask(0o007)
39
40
41def run():
42 # Run the main provisioning script.
43 from provisioningserver.__main__ import main
44 main()
45
46
47def main():
48 check_user()
49 set_group()
50 set_umask()
51 run()
52
53
54if __name__ == "__main__":
55 main()
056
=== added file 'debian/extras/maas-region'
--- debian/extras/maas-region 1970-01-01 00:00:00 +0000
+++ debian/extras/maas-region 2016-03-07 14:26:11 +0000
@@ -0,0 +1,62 @@
1#!/usr/bin/python3
2# Copyright 2015 Canonical Ltd. This software is licensed under the
3# GNU Affero General Public License version 3 (see the file LICENSE).
4
5from __future__ import (
6 absolute_import,
7 print_function,
8 unicode_literals,
9)
10
11str = None
12
13__metaclass__ = type
14__all__ = []
15
16import grp
17import os
18import sys
19
20
21def check_user():
22 # At present, only root should execute this.
23 if os.getuid() != 0:
24 raise SystemExit("This utility may only be run as root.")
25
26
27def set_group():
28 # Ensure that we're running as the `maas` group.
29 try:
30 gr_maas = grp.getgrnam("maas")
31 except KeyError:
32 raise SystemExit("No such group: maas")
33 else:
34 os.setegid(gr_maas.gr_gid)
35
36
37def set_umask():
38 # Prevent creation of world-readable (or writable, executable) files.
39 os.umask(0o007)
40
41
42def run():
43 # Force the production MAAS Django configuration.
44 os.environ.setdefault("DJANGO_SETTINGS_MODULE", "maas.settings")
45
46 # The Django configuration lives outside of sys.path.
47 sys.path.append('/usr/share/maas')
48
49 # Let Django do the rest.
50 from django.core import management
51 management.execute_from_command_line()
52
53
54def main():
55 check_user()
56 set_group()
57 set_umask()
58 run()
59
60
61if __name__ == "__main__":
62 main()
063
=== modified file 'debian/extras/maas-region-admin'
--- debian/extras/maas-region-admin 2015-12-09 02:18:13 +0000
+++ debian/extras/maas-region-admin 2016-03-07 14:26:11 +0000
@@ -2,61 +2,10 @@
2# Copyright 2015 Canonical Ltd. This software is licensed under the2# Copyright 2015 Canonical Ltd. This software is licensed under the
3# GNU Affero General Public License version 3 (see the file LICENSE).3# GNU Affero General Public License version 3 (see the file LICENSE).
44
5from __future__ import (
6 absolute_import,
7 print_function,
8 unicode_literals,
9)
10
11str = None
12
13__metaclass__ = type
14__all__ = []
15
16import grp
17import os
18import sys5import sys
196
207sys.stderr.write("""
21def check_user():8 WARNING: The maas-region-admin command is deprecated and will be removed in a future
22 # At present, only root should execute this.9 version. From now on please use 'maas-region' instead.
23 if os.getuid() != 0:10""")
24 raise SystemExit("This utility may only be run as root.")11
25
26
27def set_group():
28 # Ensure that we're running as the `maas` group.
29 try:
30 gr_maas = grp.getgrnam("maas")
31 except KeyError:
32 raise SystemExit("No such group: maas")
33 else:
34 os.setegid(gr_maas.gr_gid)
35
36
37def set_umask():
38 # Prevent creation of world-readable (or writable, executable) files.
39 os.umask(0o007)
40
41
42def run():
43 # Force the production MAAS Django configuration.
44 os.environ.setdefault("DJANGO_SETTINGS_MODULE", "maas.settings")
45
46 # The Django configuration lives outside of sys.path.
47 sys.path.append('/usr/share/maas')
48
49 # Let Django do the rest.
50 from django.core import management
51 management.execute_from_command_line()
52
53
54def main():
55 check_user()
56 set_group()
57 set_umask()
58 run()
59
60
61if __name__ == "__main__":
62 main()

Subscribers

People subscribed via source and target branches

to all changes: