Created
September 14, 2011 16:33
-
-
Save sorenmacbeth/1217029 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def _launch_cluster_instances(self, instance_templates): | |
singleton_hosts = [] | |
for instance_template in instance_templates: | |
instance_template.add_env_strings(singleton_hosts) | |
instances = self._launch_instances(instance_template) | |
if instance_template.number == 1: | |
if len(instances) != 1: | |
logger.error("Expected a single '%s' instance, but found %s.", | |
"".join(instance_template.roles), len(instances)) | |
return | |
else: | |
for role in instance_template.roles: | |
singleton_host_env = "%s_HOST=%s" % \ | |
(self._sanitize_role_name(role), | |
instances[0].public_ip) | |
singleton_hosts.append(singleton_host_env) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment