

def does_disk_exist(self, parameters, disk_name):
    ' Queries Amazon EC2 to see if the specified EBS volume exists.\n\n    Args:\n      parameters: A dict that contains the credentials needed to authenticate\n        with AWS.\n      disk_name: A str naming the EBS volume to check for existence.\n    Returns:\n      True if the named EBS volume exists, and False otherwise.\n    '
    conn = self.open_connection(parameters)
    try:
        conn.get_all_volumes([disk_name])
        AppScaleLogger.log('EBS volume {0} does exist'.format(disk_name))
        return True
    except boto.exception.EC2ResponseError:
        AppScaleLogger.log('EBS volume {0} does not exist'.format(disk_name))
        return False

dataset/ETHPy150Open AppScale/appscale-tools/lib/agents/ec2_agent.py EC2Agent.does_disk_exist/original