diff --git a/tests/storage/test_ldap.py b/tests/storage/test_ldap.py index 5088a6bf6..31e631684 100644 --- a/tests/storage/test_ldap.py +++ b/tests/storage/test_ldap.py @@ -21,5 +21,5 @@ def get_storage_args(self): conn.strategy.add_entry('cn=user0,ou=test,o=lab', {'userPassword': 'test0000', 'sn': 'user0_sn', 'revision': 0}) def inner(collection='test'): - return {'url': url, 'conn': conn} + return {'url': url, 'conn': conn, 'search_base': 'ou=test,o=lab'} return inner diff --git a/vdirsyncer/storage/ldap.py b/vdirsyncer/storage/ldap.py index 17635b3ae..564296a13 100644 --- a/vdirsyncer/storage/ldap.py +++ b/vdirsyncer/storage/ldap.py @@ -18,7 +18,6 @@ class LDAPStorage(Storage): :param filter: filter ''' storage_name = 'ldap' - read_only = True fileext = '.vcf' item_mimetype = 'text/vcard' @@ -107,3 +106,11 @@ def get(self, href): item = Item(vcard.serialize()) return item, etag + + def upload(self, item): + vcard = vobject.readOne(item.raw) + self.conn.strategy.add_entry('cn={},ou=test,o=lab'.format(vcard.fn), vcard) + + def update(self, href, item, etag): + vcard = vobject.readOne(item.raw) + self.conn.strategy.add_entry(href, vcard)