@task
def drain():
  """Drain nodes of a given type.
  This removes the instance from the region load balancers for this instance type (STAGING or PROD).
  """
  ami = get_ami_metadata()
  instance_id = ami['instance-id']
  ec2_utils.RemoveELBInstance(env.region, instance_id, env.nodetype)
  fprint('Removed instance %s from %s load balancers' % (instance_id, env.nodetype))
dataset/ETHPy150Open viewfinderco/viewfinder/fabfile.py/drain/original