Skip to content

Make SlapdObject.root_dn a property #195

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 27, 2018
Merged

Make SlapdObject.root_dn a property #195

merged 1 commit into from
Mar 27, 2018

Conversation

jdufresne
Copy link
Member

Allows overriding SlapdObject.suffix or SlapdObject.root_cn without also requiring root_dn be defined. It is now computed from the existing values at runtime. The result is an easier to use SlapdObject class.

@jdufresne
Copy link
Member Author

The test failure looks unrelated to this change.

@@ -232,6 +231,10 @@ def __init__(self):
self.clientcert = os.path.join(HERE, 'certs/client.pem')
self.clientkey = os.path.join(HERE, 'certs/client.key')

@property
def root_dn(self):
return 'cn=%s,%s' % (self.root_cn, self.suffix)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea, but please use format:

return 'cn={self.root_cn},{self.suffix}'.format(self=self)

Allows overriding SlapdObject.suffix or SlapdObject.root_cn without also
requiring root_dn be defined. It is now computed from the existing
values at runtime. The result is an easier to use SlapdObject class.
@codecov
Copy link

codecov bot commented Mar 26, 2018

Codecov Report

Merging #195 into master will decrease coverage by 1.75%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master     #195      +/-   ##
==========================================
- Coverage   70.25%   68.49%   -1.76%     
==========================================
  Files          49       49              
  Lines        4811     4803       -8     
  Branches      810      808       -2     
==========================================
- Hits         3380     3290      -90     
- Misses       1098     1182      +84     
+ Partials      333      331       -2
Impacted Files Coverage Δ
Lib/slapdtest/_slapdtest.py 80.88% <100%> (-1.78%) ⬇️
Lib/ldap/compat.py 18.86% <0%> (-47.17%) ⬇️
Lib/ldap/ldapobject.py 64.48% <0%> (-9.93%) ⬇️
Lib/ldap/sasl.py 80.55% <0%> (-5.56%) ⬇️
Modules/ldapmodule.c 59.09% <0%> (-4.91%) ⬇️
Lib/ldap/dn.py 90.38% <0%> (-3.85%) ⬇️
Lib/ldap/__init__.py 96.22% <0%> (-3.78%) ⬇️
Lib/ldap/schema/models.py 70.71% <0%> (-0.36%) ⬇️
Lib/ldap/controls/deref.py 57.14% <0%> (ø) ⬆️
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fd0ec90...651c83e. Read the comment docs.

@jdufresne
Copy link
Member Author

Thanks for the review. I've made the suggested change.

@encukou encukou merged commit 06be5eb into python-ldap:master Mar 27, 2018
@jdufresne jdufresne deleted the root-dn branch March 30, 2018 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy