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
Fixing adding authenticator indicators to host #761
Conversation
+ wrong author in the commit |
ipaserver/plugins/host.py
Outdated
| @@ -884,7 +884,8 @@ def pre_callback(self, ldap, dn, entry_attrs, attrs_list, *keys, **options): | |||
| msg = 'Principal name already set, it is unchangeable.' | |||
| raise errors.ACIError(info=msg) | |||
| obj_classes = entry_attrs_old['objectclass'] | |||
| if 'krbprincipalaux' not in obj_classes: | |||
| if 'krbprincipalaux' not in set(item.lower() for item in | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not see any reason to construct a set from the result.
|
I'd fix it on all places in host-mod: so that the plugin would be consistent. Rest of framework can be fixed other time. |
ipaserver/plugins/host.py
Outdated
| @@ -920,7 +920,7 @@ def pre_callback(self, ldap, dn, entry_attrs, attrs_list, *keys, **options): | |||
| else: | |||
| _entry_attrs = ldap.get_entry(dn, ['objectclass']) | |||
| obj_classes = _entry_attrs['objectclass'] | |||
| if 'ieee802device' not in obj_classes: | |||
| if 'ieee802device' not in [item.lower() for item in obj_classes]: | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My point was that this should be a generator expression.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By generator expression, you mean this?
(item.lower() for item in obj_classes)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes
|
Done |
ipaserver/plugins/host.py
Outdated
| @@ -949,14 +950,16 @@ def pre_callback(self, ldap, dn, entry_attrs, attrs_list, *keys, **options): | |||
| if 'objectclass' not in entry_attrs: | |||
| entry_attrs_old = ldap.get_entry(dn, ['objectclass']) | |||
| entry_attrs['objectclass'] = entry_attrs_old['objectclass'] | |||
| if 'krbticketpolicyaux' not in entry_attrs['objectclass']: | |||
| if 'krbticketpolicyaux' not in (item.lower() for item in | |||
| obj_classes): | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
obj_classes are possibly undefined here, looks like a copy-paste error to me.
ipaserver/plugins/host.py
Outdated
| entry_attrs['objectclass'].append('krbticketpolicyaux') | ||
|
|
||
| if 'krbprincipalauthind' in entry_attrs: | ||
| if 'objectclass' not in entry_attrs: | ||
| entry_attrs_old = ldap.get_entry(dn, ['objectclass']) | ||
| entry_attrs['objectclass'] = entry_attrs_old['objectclass'] | ||
| if 'krbprincipalaux' not in entry_attrs['objectclass']: | ||
| if 'krbprincipalaux' not in (item.lower() for item in | ||
| obj_classes): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
obj_classes are possibly undefined here, looks like a copy-paste error to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That exactly what happened. Thank you for pointing me that :)
It's fixed now. If you think it is, I can squash my commits into a single one.
|
Yes, that seems to have fixed that. Please do squash them now, I guess we can ACK this ;) |
The check for krbprincipalaux in the entries is now made case-insensitively. https://pagure.io/freeipa/issue/6911
|
Cool :)) thanks! |
The check for krbprincipalaux in the entries is now made case-insensitively.
https://pagure.io/freeipa/issue/6911
https://bugzilla.redhat.com/show_bug.cgi?id=1441593#c2