~smoser/ec2-init/ec2-init.smoser

« back to all changes in this revision

Viewing changes to ec2-set-defaults.py

  • Committer: Soren Hansen
  • Date: 2009-08-11 06:20:55 UTC
  • Revision ID: soren@canonical.com-20090811062055-51d5lk2rn2w77fbr
Remove call to update-motd from the init script. It is Ubuntu specific (and is possibly not even needed there)

Fix a bit of fallout due to code shuffling between EC2Init, ec2-set-apt-sources, and ec2-set-defaults.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
#
21
21
 
22
22
import subprocess
 
23
from Cheetah.Template import Template
23
24
 
24
25
import ec2init
25
26
 
39
40
    subprocess.Popen(['locale-gen', locale]).communicate()
40
41
    subprocess.Popen(['update-locale', locale]).communicate()
41
42
 
42
 
def generate_sources_list(self, mirror)
 
43
def generate_sources_list(mirror):
43
44
    stdout, stderr = subprocess.Popen(['lsb_release', '-cs'], stdout=subprocess.PIPE).communicate()
44
45
    codename = stdout.strip()
45
46
 
46
47
    mp = { 'mirror' : mirror, 'codename' : codename }
47
48
    t = Template(file='/etc/ec2-init/templates/sources.list.tmpl', searchList=[mp])
48
 
    f = open(SOURCES_LIST, 'w')
 
49
    f = open('/etc/apt/sources.list', 'w')
49
50
    f.write(t.respond())
50
51
    f.close()
51
52