'Returns a list of :class:`ExEC2AvailabilityZone` objects for the
current region.
Note: This is an extension method and is only available for EC2
driver.
:keyword  only_available: If true, returns only availability zones
with state \'available\'
:type     only_available: ``str``
:rtype: ``list`` of :class:`ExEC2AvailabilityZone`'

def ex_list_availability_zones(self, only_available=True):

    params = {'Action': 'DescribeAvailabilityZones'}
    filters = {'region-name': self.region_name}
    if only_available:
        filters['state'] = 'available'
    params.update(self._build_filters(filters))
    result = self.connection.request(self.path, params=params.copy()).object
    availability_zones = []
    for element in findall(element=result, xpath='availabilityZoneInfo/item', namespace=NAMESPACE):
        name = findtext(element=element, xpath='zoneName', namespace=NAMESPACE)
        zone_state = findtext(element=element, xpath='zoneState', namespace=NAMESPACE)
        region_name = findtext(element=element, xpath='regionName', namespace=NAMESPACE)
        availability_zone = ExEC2AvailabilityZone(name=name, zone_state=zone_state, region_name=region_name)
        availability_zones.append(availability_zone)
    return availability_zones
