{"action":"created","issue":{"url":"https://api.github.com/repos/cannatag/ldap3/issues/188","repository_url":"https://api.github.com/repos/cannatag/ldap3","labels_url":"https://api.github.com/repos/cannatag/ldap3/issues/188/labels{/name}","comments_url":"https://api.github.com/repos/cannatag/ldap3/issues/188/comments","events_url":"https://api.github.com/repos/cannatag/ldap3/issues/188/events","html_url":"https://github.com/cannatag/ldap3/issues/188","id":160851883,"number":188,"title":"Working with distinguished names","user":{"login":"cajus","id":722353,"avatar_url":"https://avatars.githubusercontent.com/u/722353?v=3","gravatar_id":"","url":"https://api.github.com/users/cajus","html_url":"https://github.com/cajus","followers_url":"https://api.github.com/users/cajus/followers","following_url":"https://api.github.com/users/cajus/following{/other_user}","gists_url":"https://api.github.com/users/cajus/gists{/gist_id}","starred_url":"https://api.github.com/users/cajus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cajus/subscriptions","organizations_url":"https://api.github.com/users/cajus/orgs","repos_url":"https://api.github.com/users/cajus/repos","events_url":"https://api.github.com/users/cajus/events{/privacy}","received_events_url":"https://api.github.com/users/cajus/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-06-17T09:51:01Z","updated_at":"2016-06-22T13:20:45Z","closed_at":"2016-06-22T13:20:45Z","body":"It looks like the \"old\" python-ldap module is no more shipped by some distributions, so I'm currently looking for something I can migrate my code base to. Just found the ldap3 module - and here I am ;-)\r\n\r\nCurrently I'm looking into the ldap3.utils.dn methods, and I either don't understand how they're intended to be used or there's a bit missing somewhere.\r\n\r\nMy old code contains parts needed to split the DN into its main parts (including the RDN) and do something with it. Then assemble it back to its string representation.\r\n\r\nSimple example that gets the container DN for a given DN:\r\n\r\n```\r\nfrom ldap.dn import dn2str, str2dn\r\ndn = \"cn=Frank Möller+uid=moellerm,ou=sales,dc=example,dc=com\"\r\nprint(dn2str(str2dn(dn)[1:]))\r\n```\r\n\r\nHow can I achieve this with the ldap3 module? There's a `parse_dn` that outputs some format which is complicated to split (because of the RDN \"+\" in the tuple where I've to inspect every single item if it's part of the previous RDN or not) and there doesn't seem to be a method in the ldap3.utils.dn namespace which can reverse the process of parsing to assemble a DN string."},"comment":{"url":"https://api.github.com/repos/cannatag/ldap3/issues/comments/227740983","html_url":"https://github.com/cannatag/ldap3/issues/188#issuecomment-227740983","issue_url":"https://api.github.com/repos/cannatag/ldap3/issues/188","id":227740983,"user":{"login":"cajus","id":722353,"avatar_url":"https://avatars.githubusercontent.com/u/722353?v=3","gravatar_id":"","url":"https://api.github.com/users/cajus","html_url":"https://github.com/cajus","followers_url":"https://api.github.com/users/cajus/followers","following_url":"https://api.github.com/users/cajus/following{/other_user}","gists_url":"https://api.github.com/users/cajus/gists{/gist_id}","starred_url":"https://api.github.com/users/cajus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cajus/subscriptions","organizations_url":"https://api.github.com/users/cajus/orgs","repos_url":"https://api.github.com/users/cajus/repos","events_url":"https://api.github.com/users/cajus/events{/privacy}","received_events_url":"https://api.github.com/users/cajus/received_events","type":"User","site_admin":false},"created_at":"2016-06-22T13:20:45Z","updated_at":"2016-06-22T13:20:45Z","body":"I'm using python3.5 on Fedora 24 and just did a \"pip install ldap3\" inside of a virtualenv. From the installed eggs it looks like version 1.3.1.\r\n\r\nHere's a \"print(c)\" in the dn.py. I can't find it in git, though. Maybe I've added it some time ago to try to understand how these methods are intended to use. I don't remember and it's strange because I clean the virtualenv from time to time. Whatever. I've removed the print() and - what a wonder - the output is gone away...\r\n\r\nCurrently I found that porting pyldap to debian/ubuntu is less work than adapting hundreds of lines of LDAP code to the ldap3 module due to usage incompatibilities. So I'll stay there for now. Maybe I'll do some API glue layer if there's a need to migrate. Whatever.\r\n\r\nThanks for your time, anyway."}}
{"actor":{"display_login":"cajus"}}