Merge lp:~javier.collado/utah/bug1126219 into lp:utah

Proposed by Javier Collado
Status: Merged
Approved by: Javier Collado
Approved revision: 850
Merged at revision: 849
Proposed branch: lp:~javier.collado/utah/bug1126219
Merge into: lp:utah
Diff against target: 116 lines (+16/-15)
6 files modified
debian/changelog (+1/-0)
examples/run_install_test.py (+3/-3)
examples/run_test_bamboo_feeder.py (+3/-3)
examples/run_test_cobbler.py (+3/-3)
examples/run_test_vm.py (+3/-3)
examples/run_utah_tests.py (+3/-3)
To merge this branch: bzr merge lp:~javier.collado/utah/bug1126219
Reviewer Review Type Date Requested Status
UTAH Dev Pending
Review via email: mp+156342@code.launchpad.net

Description of the change

In this branch, user group is checked after parsing arguments. This way
-h/--help can be used even when running the run scripts with a user that isn't
a member of the utah group.

To post a comment you must log in.
Revision history for this message
Andy Doan (doanac) wrote :

+1 - thank you

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 2013-03-29 12:27:37 +0000
3+++ debian/changelog 2013-04-01 11:59:23 +0000
4@@ -3,6 +3,7 @@
5 * Return error code on unhandled error (LP: #1160857)
6 * Remove temporary files downloaded based on URL (LP: #1101186)
7 * Stop server on installation failure (LP: #1161855)
8+ * Check group after command line argument parsing (LP: #1126219)
9
10 -- Javier Collado <javier.collado@canonical.com> Wed, 27 Mar 2013 13:00:47 +0100
11
12
13=== modified file 'examples/run_install_test.py'
14--- examples/run_install_test.py 2013-03-28 11:55:27 +0000
15+++ examples/run_install_test.py 2013-04-01 11:59:23 +0000
16@@ -53,13 +53,13 @@
17
18
19 def run_install_test(args=None):
20+ if args is None:
21+ args = get_parser().parse_args()
22+
23 if not check_user_group():
24 print_group_error_message(__file__)
25 sys.exit(ReturnCodes.GROUP_ERROR)
26
27- if args is None:
28- args = get_parser().parse_args()
29-
30 locallogs = []
31 exitstatus = ReturnCodes.SUCCESS
32 machine = None
33
34=== modified file 'examples/run_test_bamboo_feeder.py'
35--- examples/run_test_bamboo_feeder.py 2013-03-28 11:55:27 +0000
36+++ examples/run_test_bamboo_feeder.py 2013-04-01 11:59:23 +0000
37@@ -54,13 +54,13 @@
38
39
40 def run_test_bamboo_feeder(args=None):
41+ if args is None:
42+ args = get_parser().parse_args()
43+
44 if not check_user_group():
45 print_group_error_message(__file__)
46 sys.exit(ReturnCodes.GROUP_ERROR)
47
48- if args is None:
49- args = get_parser().parse_args()
50-
51 locallogs = []
52 exitstatus = ReturnCodes.SUCCESS
53 machine = None
54
55=== modified file 'examples/run_test_cobbler.py'
56--- examples/run_test_cobbler.py 2013-03-28 11:55:27 +0000
57+++ examples/run_test_cobbler.py 2013-04-01 11:59:23 +0000
58@@ -53,13 +53,13 @@
59
60
61 def run_test_cobbler(args=None):
62+ if args is None:
63+ args = get_parser().parse_args()
64+
65 if not check_user_group():
66 print_group_error_message(__file__)
67 sys.exit(ReturnCodes.GROUP_ERROR)
68
69- if args is None:
70- args = get_parser().parse_args()
71-
72 locallogs = []
73 exitstatus = ReturnCodes.SUCCESS
74 machine = None
75
76=== modified file 'examples/run_test_vm.py'
77--- examples/run_test_vm.py 2013-03-28 11:55:27 +0000
78+++ examples/run_test_vm.py 2013-04-01 11:59:23 +0000
79@@ -46,13 +46,13 @@
80
81
82 def run_test_vm(args=None):
83+ if args is None:
84+ args = get_parser().parse_args()
85+
86 if not check_user_group():
87 print_group_error_message(__file__)
88 sys.exit(ReturnCodes.GROUP_ERROR)
89
90- if args is None:
91- args = get_parser().parse_args()
92-
93 locallogs = []
94 exitstatus = ReturnCodes.SUCCESS
95 machine = None
96
97=== modified file 'examples/run_utah_tests.py'
98--- examples/run_utah_tests.py 2013-03-28 11:55:27 +0000
99+++ examples/run_utah_tests.py 2013-04-01 11:59:23 +0000
100@@ -68,13 +68,13 @@
101
102
103 def run_utah_tests(args=None):
104+ if args is None:
105+ args = get_parser().parse_args()
106+
107 if not check_user_group():
108 print_group_error_message(__file__)
109 sys.exit(ReturnCodes.GROUP_ERROR)
110
111- if args is None:
112- args = get_parser().parse_args()
113-
114 if args.machinetype is None:
115 machinetype = config.machinetype
116 else:

Subscribers

People subscribed via source and target branches