Skip to content

Commit

Permalink
Less but better output
Browse files Browse the repository at this point in the history
  • Loading branch information
stroeder committed Sep 19, 2015
1 parent 4d2fdec commit 3a84c23
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Demo/pyasn1/derefcontrol.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class MyLDAPObject(ldap.ldapobject.LDAPObject,ldap.resiter.ResultProcessor):
pass


l = MyLDAPObject(uri,trace_level=2)
l = MyLDAPObject(uri,trace_level=0)
l.simple_bind_s('uid=diradm,dc=example,dc=com','testsecret')

dc = DereferenceControl(
Expand All @@ -30,8 +30,9 @@ class MyLDAPObject(ldap.ldapobject.LDAPObject,ldap.resiter.ResultProcessor):
],
}
)

print 'pyasn1 output of request control:'
print dc._derefSpecs().prettyPrint()
dc.encodeControlValue()

msg_id = l.search_ext(
'dc=example,dc=com',
Expand All @@ -45,3 +46,5 @@ class MyLDAPObject(ldap.ldapobject.LDAPObject,ldap.resiter.ResultProcessor):
for dn,entry,deref_control in res_data:
# process dn and entry
print dn,entry['objectClass']
if deref_control:
pprint.pprint(deref_control[0].derefRes)

0 comments on commit 3a84c23

Please sign in to comment.