Merge lp:~mhall119/awstrial/remove-byobu-enable-850957 into lp:awstrial

Proposed by Michael Hall
Status: Merged
Approved by: Matthew Nuzum
Approved revision: 265
Merged at revision: 266
Proposed branch: lp:~mhall119/awstrial/remove-byobu-enable-850957
Merge into: lp:awstrial
Diff against target: 81 lines (+10/-19)
3 files modified
awstrial/templates/cloud-init/byobu-countdown (+3/-8)
awstrial/trial/ec2_helper.py (+6/-9)
awstrial/trial/views.py (+1/-2)
To merge this branch: bzr merge lp:~mhall119/awstrial/remove-byobu-enable-850957
Reviewer Review Type Date Requested Status
Matthew Nuzum (community) Approve
Review via email: mp+79965@code.launchpad.net

Commit message

Convert byobu-enable script to just installing the countdown widget, include it all the time

Description of the change

Convert byobu-enable script to just installing the countdown widget, include it all the time

To post a comment you must log in.
Revision history for this message
Matthew Nuzum (newz) wrote :

Looks good

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== renamed file 'awstrial/templates/cloud-init/byobu-enable' => 'awstrial/templates/cloud-init/byobu-countdown'
2--- awstrial/templates/cloud-init/byobu-enable 2010-09-30 12:58:03 +0000
3+++ awstrial/templates/cloud-init/byobu-countdown 2011-10-20 14:14:30 +0000
4@@ -1,14 +1,9 @@
5 #!/bin/sh
6-#sudo -Hu ubuntu byobu-launcher-install # single user
7-sem="/var/lib/cloud/sem/byobu-enable.${INSTANCE_ID}"
8+
9+sem="/var/lib/cloud/sem/byobu-countdown.${INSTANCE_ID}"
10 [ -e "${sem}" ] && exit 0
11
12-debconf-set-selections <<EOF
13-byobu byobu/launch-by-default boolean true
14-EOF
15-dpkg-reconfigure byobu --frontend=noninteractive
16-
17-# above does it for all users, but below is only for 'ubuntu' user
18+# Add AWSTrial countdown widget only for 'ubuntu' user
19 sudo -Hu ubuntu sh -c 'mkdir -p ~/.byobu/bin/ &&
20 cat > ~/.byobu/bin/1_countdown && chmod +x ~/.byobu/bin/1_countdown' <<"EOF"
21 #!/bin/sh
22
23=== modified file 'awstrial/trial/ec2_helper.py'
24--- awstrial/trial/ec2_helper.py 2011-10-19 19:41:55 +0000
25+++ awstrial/trial/ec2_helper.py 2011-10-20 14:14:30 +0000
26@@ -63,8 +63,7 @@
27
28 return connection
29
30-def runit(campaign,lpid=None,regions=None,config=None, byobu=False,
31- password=None):
32+def runit(campaign,lpid=None,regions=None,config=None, password=None):
33 sec_key = util.rand_str(32)
34 if regions is None:
35 regions = [r for r in settings.REGIONS_TRY_ORDER
36@@ -73,7 +72,6 @@
37 if settings.REGION2AMI.has_key(r)]
38
39 cust = { }
40- cust['byobu'] = False
41 cust['config'] = config
42 cust['password'] = password
43
44@@ -115,12 +113,11 @@
45 { 'debug' : settings.DEBUG, 'user': 'ubuntu', 'password' : password }),
46 part_type=util.CI_SCRIPT, filename="55-password-enable"))
47
48- if str(byobu).lower() == "true":
49- parts.append(
50- util.partItem(
51- render_to_string("byobu-enable", { 'debug' : settings.DEBUG, }),
52- part_type=util.CI_BOOTHOOK, filename="byobu-enable"))
53- cust['byobu']=True
54+ parts.append(
55+ util.partItem(
56+ render_to_string("byobu-countdown", { 'debug' : settings.DEBUG, }),
57+ part_type=util.CI_BOOTHOOK, filename="byobu-countdown"))
58+ cust['byobu']=True
59
60 instcfg = None
61 for c in settings.CONFIGS:
62
63=== modified file 'awstrial/trial/views.py'
64--- awstrial/trial/views.py 2011-10-18 20:11:39 +0000
65+++ awstrial/trial/views.py 2011-10-20 14:14:30 +0000
66@@ -86,14 +86,13 @@
67 else:
68 regions = settings.REGIONS_TRY_ORDER
69 config = request.POST.get('config', '')
70- byobu = request.POST.get('byobu','')
71 set_password = request.POST.get('set_password',None)
72
73 password=None
74 if set_password:
75 password=util.rand_user_password()
76
77- ec2_helper.runit(campaign,lpid=request.user, regions=regions, config=config, byobu=byobu, password=password)
78+ ec2_helper.runit(campaign,lpid=request.user, regions=regions, config=config, password=password)
79 #send_mail(subject, message, from_email, ['davewalker@ubuntu.com'])
80 #except BadHeaderError: #Example of basic error handling
81 # return HttpResponse('Invalid header found.')

Subscribers

People subscribed via source and target branches