'>>> driver = DummyDNSDriver(\'key\', \'secret\')
>>> zone = driver.create_zone(domain=\'apache.org\', type=\'master\',
...                           ttl=100)
>>> record = driver.create_record(name=\'libcloud\', zone=zone,
...                               type=RecordType.A, data=\'127.0.0.1\')
>>> record #doctest: +ELLIPSIS
<Record: zone=apache.org, name=libcloud, type=A, data=127.0.0.1...>
>>> record = driver.create_record(name=\'libcloud\', zone=zone,
...                               type=RecordType.A, data=\'127.0.0.1\')
... #doctest: +IGNORE_EXCEPTION_DETAIL
Traceback (most recent call last):
RecordAlreadyExistsError:
@inherits: :class:`DNSDriver.create_record`'

def create_record(self, name, zone, type, data, extra=None):

    id = ('id-%s' % name)
    zone = self.get_zone(zone_id=zone.id)
    if (id in self._zones[zone.id]['records']):
        raise RecordAlreadyExistsError(record_id=id, value=None, driver=self)
    record = Record(id=id, name=name, type=type, data=data, extra=extra, zone=zone, driver=self)
    self._zones[zone.id]['records'][id] = record
    return record
