

def does_zone_exist(self, parameters):
    ' Queries Amazon EC2 to see if the specified availability zone exists.\n\n    Args:\n      parameters: A dict that contains the availability zone to check for\n        existence.\n    Returns:\n      True if the availability zone exists, and False otherwise.\n    '
    try:
        conn = self.open_connection(parameters)
        zone = parameters[self.PARAM_ZONE]
        conn.get_all_zones(zone)
        AppScaleLogger.log('Availability zone {0} does exist'.format(zone))
        return True
    except boto.exception.EC2ResponseError:
        AppScaleLogger.log('Availability zone {0} does not exist'.format(zone))
        return False

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