Commit 23207c69 by Feanil Patel

Don't run pre-supervisor on abbey builds.

parent 11ee7016
......@@ -96,6 +96,16 @@ if __name__ == '__main__':
instance_id = get_instance_metadata()['instance-id']
prefix = instance_id
ec2 = boto.connect_ec2()
reservations = ec2.get_all_instances(instance_ids=[instance_id])
instance = reservations[0].instances[0]
if instance.instance_profile['arn'].endswith('/abbey'):
print("Running an abbey build. Not starting any services.")
# Needs to exit with 1 instead of 0 to prevent
# services from starting.
exit(1)
try:
environment, deployment, play = edp_for_instance(instance_id)
prefix = "{environment}-{deployment}-{play}-{instance_id}".format(
......@@ -103,6 +113,10 @@ if __name__ == '__main__':
deployment=deployment,
play=play,
instance_id=instance_id)
except:
print("Failed to get EDP for {}".format(instance_id))
try:
for service in services_for_instance(instance_id):
if service in MIGRATION_COMMANDS:
# Do extra migration related stuff.
......@@ -144,6 +158,7 @@ if __name__ == '__main__':
print(msg)
if notify:
notify(msg)
traceback.print_exc()
else:
msg = "{}: {}".format(prefix, " | ".join(report))
print(msg)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment