diff --git a/providers/ec2/__init__.py b/providers/ec2/__init__.py index a10c619..f182de5 100644 --- a/providers/ec2/__init__.py +++ b/providers/ec2/__init__.py @@ -6,7 +6,7 @@ from tasks import host from tasks import ebs from tasks import filesystem from tasks import bootstrap -from tasks import config +from tasks import locale from tasks import apt @@ -36,9 +36,9 @@ def tasks(tasklist, manifest): tasklist.add(bootstrap.MakeTarball()) tasklist.add(bootstrap.Bootstrap(), filesystem.MountSpecials(), - config.GenerateLocale(), - config.SetTimezone(), - config.AptSources(), + locale.GenerateLocale(), + locale.SetTimezone(), + apt.AptSources(), apt.AptUpgrade()) from common.tasks import TriggerRollback diff --git a/providers/ec2/tasks/apt.py b/providers/ec2/tasks/apt.py index 87161d2..6ab6dfc 100644 --- a/providers/ec2/tasks/apt.py +++ b/providers/ec2/tasks/apt.py @@ -2,7 +2,23 @@ from base import Task from common import phases from common.tools import log_check_call import os -from config import AptSources + + +class AptSources(Task): + description = 'Adding aptitude sources' + phase = phases.system_modification + + def run(self, info): + sources_path = os.path.join(info.root, 'etc/apt/sources.list') + with open(sources_path, 'w') as apt_sources: + apt_sources.write(('deb {apt_mirror} {release} main\n' + 'deb-src {apt_mirror} {release} main\n'. + format(apt_mirror='http://http.debian.net/debian', + release=info.manifest.system['release']))) + apt_sources.write(('deb {apt_mirror} {release}/updates main\n' + 'deb-src {apt_mirror} {release}/updates main\n'. + format(apt_mirror='http://security.debian.org/', + release=info.manifest.system['release']))) class AptUpgrade(Task): diff --git a/providers/ec2/tasks/config.py b/providers/ec2/tasks/locale.py similarity index 60% rename from providers/ec2/tasks/config.py rename to providers/ec2/tasks/locale.py index 94738ef..db478fd 100644 --- a/providers/ec2/tasks/config.py +++ b/providers/ec2/tasks/locale.py @@ -33,20 +33,3 @@ class SetTimezone(Task): zoneinfo_path = os.path.join(info.root, '/usr/share/zoneinfo', timezone) localtime_path = os.path.join(info.root, 'etc/localtime') copy(zoneinfo_path, localtime_path) - - -class AptSources(Task): - description = 'Adding aptitude sources' - phase = phases.system_modification - - def run(self, info): - sources_path = os.path.join(info.root, 'etc/apt/sources.list') - with open(sources_path, 'w') as apt_sources: - apt_sources.write(('deb {apt_mirror} {release} main\n' - 'deb-src {apt_mirror} {release} main\n'. - format(apt_mirror='http://http.debian.net/debian', - release=info.manifest.system['release']))) - apt_sources.write(('deb {apt_mirror} {release}/updates main\n' - 'deb-src {apt_mirror} {release}/updates main\n'. - format(apt_mirror='http://security.debian.org/', - release=info.manifest.system['release'])))