events.log(node, component, message, logging) if __name__ == '__main__': log('leaving the cluster', 'info') #try: # do not remove the tag, we might want to work on this later # delete all there is to us #log('unset the tag', 'info') #ec2.unset_tag() #except Exception as e: #log(e, 'error') try: log('delete the Route53 record', 'info') r53_zone.delete_record(node) except Exception as e: log(e, 'error') try: log('delete from the cluster', 'info') cluster.delete_node(node) # and the last to leave, please close the door size = cluster.size() if size <= 0: log('delete the master Route53 record', 'info') r53_zone.delete_record(cluster.name()) except Exception as e: log(e, 'error')