

def does_address_exist(self, parameters):
    ' Queries Amazon EC2 to see if the specified Elastic IP address has been\n    allocated with the given credentials.\n\n    Args:\n      parameters: A dict that contains the Elastic IP to check for existence.\n    Returns:\n      True if the given Elastic IP has been allocated, and False otherwise.\n    '
    try:
        conn = self.open_connection(parameters)
        elastic_ip = parameters[self.PARAM_STATIC_IP]
        conn.get_all_addresses(elastic_ip)
        AppScaleLogger.log('Elastic IP {0} can be used for this AppScale deployment.'.format(elastic_ip))
        return True
    except boto.exception.EC2ResponseError:
        AppScaleLogger.log('Elastic IP {0} does not exist.'.format(elastic_ip))
        return False

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