bootstrap-vz/providers/ec2/tasks/host.py
Anders Ingemann 1c93094833 Integrated package plugin with base system
New phase introduced "package installation" (fixes #114)
Apt source lines are now parsed, this allows to verify the target release of added packages.
All packages (except locales) are now installed *after* bootstrapping (fixes #123)
Added env argument to log_(check_)call
HostDependencies have been refactored a little
2013-12-29 20:58:06 +01:00

26 lines
686 B
Python

from base import Task
from common import phases
from common.tasks import host
class HostDependencies(Task):
description = 'Adding more required host packages'
phase = phases.preparation
successors = [host.CheckHostDependencies]
def run(self, info):
if info.manifest.volume['backing'] == 's3':
info.host_dependencies.add('euca2ools')
class GetInfo(Task):
description = 'Retrieving instance metadata'
phase = phases.preparation
def run(self, info):
import urllib2
import json
metadata_url = 'http://169.254.169.254/latest/dynamic/instance-identity/document'
response = urllib2.urlopen(url=metadata_url, timeout=5)
info.host = json.load(response)
return info