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
=== renamed file 'awstrial/templates/cloud-init/byobu-enable' => 'awstrial/templates/cloud-init/byobu-countdown'
--- awstrial/templates/cloud-init/byobu-enable 2010-09-30 12:58:03 +0000
+++ awstrial/templates/cloud-init/byobu-countdown 2011-10-20 14:14:30 +0000
@@ -1,14 +1,9 @@
1#!/bin/sh1#!/bin/sh
2#sudo -Hu ubuntu byobu-launcher-install # single user2
3sem="/var/lib/cloud/sem/byobu-enable.${INSTANCE_ID}"3sem="/var/lib/cloud/sem/byobu-countdown.${INSTANCE_ID}"
4[ -e "${sem}" ] && exit 04[ -e "${sem}" ] && exit 0
55
6debconf-set-selections <<EOF6# Add AWSTrial countdown widget only for 'ubuntu' user
7byobu byobu/launch-by-default boolean true
8EOF
9dpkg-reconfigure byobu --frontend=noninteractive
10
11# above does it for all users, but below is only for 'ubuntu' user
12sudo -Hu ubuntu sh -c 'mkdir -p ~/.byobu/bin/ &&7sudo -Hu ubuntu sh -c 'mkdir -p ~/.byobu/bin/ &&
13 cat > ~/.byobu/bin/1_countdown && chmod +x ~/.byobu/bin/1_countdown' <<"EOF"8 cat > ~/.byobu/bin/1_countdown && chmod +x ~/.byobu/bin/1_countdown' <<"EOF"
14#!/bin/sh9#!/bin/sh
1510
=== modified file 'awstrial/trial/ec2_helper.py'
--- awstrial/trial/ec2_helper.py 2011-10-19 19:41:55 +0000
+++ awstrial/trial/ec2_helper.py 2011-10-20 14:14:30 +0000
@@ -63,8 +63,7 @@
6363
64 return connection64 return connection
6565
66def runit(campaign,lpid=None,regions=None,config=None, byobu=False,66def runit(campaign,lpid=None,regions=None,config=None, password=None):
67 password=None):
68 sec_key = util.rand_str(32)67 sec_key = util.rand_str(32)
69 if regions is None:68 if regions is None:
70 regions = [r for r in settings.REGIONS_TRY_ORDER69 regions = [r for r in settings.REGIONS_TRY_ORDER
@@ -73,7 +72,6 @@
73 if settings.REGION2AMI.has_key(r)]72 if settings.REGION2AMI.has_key(r)]
7473
75 cust = { }74 cust = { }
76 cust['byobu'] = False
77 cust['config'] = config75 cust['config'] = config
78 cust['password'] = password76 cust['password'] = password
7977
@@ -115,12 +113,11 @@
115 { 'debug' : settings.DEBUG, 'user': 'ubuntu', 'password' : password }),113 { 'debug' : settings.DEBUG, 'user': 'ubuntu', 'password' : password }),
116 part_type=util.CI_SCRIPT, filename="55-password-enable"))114 part_type=util.CI_SCRIPT, filename="55-password-enable"))
117115
118 if str(byobu).lower() == "true":116 parts.append(
119 parts.append(117 util.partItem(
120 util.partItem(118 render_to_string("byobu-countdown", { 'debug' : settings.DEBUG, }),
121 render_to_string("byobu-enable", { 'debug' : settings.DEBUG, }),119 part_type=util.CI_BOOTHOOK, filename="byobu-countdown"))
122 part_type=util.CI_BOOTHOOK, filename="byobu-enable"))120 cust['byobu']=True
123 cust['byobu']=True
124121
125 instcfg = None122 instcfg = None
126 for c in settings.CONFIGS:123 for c in settings.CONFIGS:
127124
=== modified file 'awstrial/trial/views.py'
--- awstrial/trial/views.py 2011-10-18 20:11:39 +0000
+++ awstrial/trial/views.py 2011-10-20 14:14:30 +0000
@@ -86,14 +86,13 @@
86 else:86 else:
87 regions = settings.REGIONS_TRY_ORDER87 regions = settings.REGIONS_TRY_ORDER
88 config = request.POST.get('config', '')88 config = request.POST.get('config', '')
89 byobu = request.POST.get('byobu','')
90 set_password = request.POST.get('set_password',None)89 set_password = request.POST.get('set_password',None)
9190
92 password=None91 password=None
93 if set_password:92 if set_password:
94 password=util.rand_user_password()93 password=util.rand_user_password()
9594
96 ec2_helper.runit(campaign,lpid=request.user, regions=regions, config=config, byobu=byobu, password=password)95 ec2_helper.runit(campaign,lpid=request.user, regions=regions, config=config, password=password)
97 #send_mail(subject, message, from_email, ['davewalker@ubuntu.com'])96 #send_mail(subject, message, from_email, ['davewalker@ubuntu.com'])
98 #except BadHeaderError: #Example of basic error handling97 #except BadHeaderError: #Example of basic error handling
99 # return HttpResponse('Invalid header found.')98 # return HttpResponse('Invalid header found.')

Subscribers

People subscribed via source and target branches