

@cli.command(help='Terminate a EMR cluster')
@click.option('--cluster-id', '-i', required=True, help='EMR cluster id')
def rm(cluster_id):
    'Terminate a EMR cluster'
    client = boto3.client('emr')
    try:
        result = client.describe_cluster(ClusterId=cluster_id)
        target_dns = result['Cluster']['MasterPublicDnsName']
        flag = click.prompt('Are you sure you want to terminate {0}: {1}? [y/Y]'.format(cluster_id, target_dns), type=str, default='n')
        if (flag.lower() == 'y'):
            result = client.terminate_job_flows(JobFlowIds=[cluster_id])
    except ClientError as e:
        click.echo(e, err=True)

dataset/ETHPy150Open achiku/jungle/jungle/emr.py rm/original