2013-06-23 12:00:17 +02:00
|
|
|
from base import Task
|
2013-06-23 15:26:08 +02:00
|
|
|
from common import phases
|
|
|
|
from connection import Connect
|
2013-06-23 12:00:17 +02:00
|
|
|
|
|
|
|
class CreateVolume(Task):
|
|
|
|
description = 'Creating an EBS volume for bootstrapping'
|
2013-06-23 22:12:29 +02:00
|
|
|
phase = phases.volume_creation
|
2013-06-23 15:26:08 +02:00
|
|
|
after = [Connect]
|
2013-06-23 12:00:17 +02:00
|
|
|
|
|
|
|
def run(self, info):
|
|
|
|
# info.conn.create_volume(50, "us-west-2")
|
|
|
|
# volume_id=`euca-create-volume --size $volume_size --zone "$availability_zone" | awk '{print $2}'`
|
|
|
|
# [ -z "$volume_id" ] && die "Unable to create volume."
|
|
|
|
# log "The EBS volume id is $volume_id"
|
|
|
|
|
|
|
|
# for package in info.host_packages:
|
|
|
|
# try:
|
|
|
|
# with open(devnull, 'w') as dev_null:
|
|
|
|
# subprocess.check_call(['/usr/bin/dpkg', '-s', package], stdout=dev_null, stderr=dev_null)
|
|
|
|
# except subprocess.CalledProcessError:
|
|
|
|
# msg = "The package ``{0}\'\' is not installed".format(package)
|
|
|
|
# raise RuntimeError(msg)
|
|
|
|
pass
|
|
|
|
|