Skip to content
Permalink
Browse files
Revert "Don't destroy the node after we're done, for mig5."
This reverts commit 2505124.
  • Loading branch information
darthsteven committed Feb 13, 2012
1 parent 2505124 commit 553970343aec3143535b075d18d87485a4abcf23
Showing 1 changed file with 21 additions and 21 deletions.
@@ -37,7 +37,7 @@

# These are used as options to Aegir during install
email = config.get('Aegir', 'email')


def main(argv=None):
if argv is None:
@@ -57,60 +57,60 @@ def main(argv=None):
if o in ("--aegir_version"):
aegir_version = a
if o in ("--drush_version"):
drush_version = a

drush_version = a
# Check the command line options
if aegir_version is None:
raise Usage, "the --aegir_version option must be specified"
if drush_version is None:
raise Usage, "the --drush_version option must be specified"


# Now we can get on with the testing

# Run some tests
dependency_check()

# Make a new connection
Driver = get_driver( getattr(Provider, provider_driver) )
conn = Driver(user, key)

# Get a list of the available images and sizes
images = conn.list_images()
sizes = conn.list_sizes()

# We'll use the distro and size from the config ini
preferred_image = [image for image in images if config_distro in image.name]
assert len(preferred_image) == 1, "We found more than one image for %s, will be assuming the first one" % config_distro

preferred_size = [size for size in sizes if config_size in size.name]

# The MySQL root password is hardcoded here for now, as it's in our Squeeze LAMP image.
mysqlpass = "8su43x"

# Commands to run immediately after installation
dispatch = [
SSHKeyDeployment(open(os.path.expanduser("~/.ssh/id_rsa.pub")).read()),
]
msd = MultiStepDeployment(dispatch)

# Create and deploy a new server now, and run the deployment steps defined above
print "Provisioning server and running deployment processes"
try:
node = conn.deploy_node(name='aegir' + os.environ['BUILD_ID'], image=preferred_image[0], size=preferred_size[0], deploy=msd)
node = conn.deploy_node(name='aegir' + os.environ['BUILD_ID'], image=preferred_image[0], size=preferred_size[0], deploy=msd)
except:
e = sys.exc_info()[1]
raise SystemError(e)

print "Provisioning complete, you can ssh as root to %s" % node.public_ip[0]
if node.extra.get('password'):
print "The root user's password is %s" % node.extra.get('password')

# Setting some parameters for fabric
domain = socket.getfqdn(node.public_ip[0])
fabric.env.host_string = domain
fabric.env.user = 'root'

try:
fab_prepare_firewall()
fab_prepare_apache()
@@ -122,12 +122,12 @@ def main(argv=None):
except:
print "===> Test failure"
raise
finally:
finally:
print "===> Destroying this node"
#conn.destroy_node(node)

conn.destroy_node(node)
return 0

except Usage, err:
print >>sys.stderr, err.msg
print >>sys.stderr, "for help use --help"

0 comments on commit 5539703

Please sign in to comment.