-
Notifications
You must be signed in to change notification settings - Fork 18
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
roles, adding default domain password policy management #139
base: master
Are you sure you want to change the base?
Conversation
6ce3b2f
to
a0156fe
Compare
e63f374
to
fe86c02
Compare
"minclasses": (self.cli.option.VALUE, 5), | ||
"priority": (self.cli.option.VALUE, 1), | ||
} | ||
self._add(attrs) |
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.
Why are you calling self._add()
here but self._modify()
in the else
section?
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.
It's the way the command is constructed. IPARole._add
is ipa pwpolicy add
, while IPARole._modify
is ipa pwpolicy modify
. If enabled, we are adding the values that don't exist, to disable it, we are modifying the existing values.
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.
What happens if the test has code like this?
ipp = IPAPasswordPolicy(...)
...
ipp.complexity(true)
...
ipp.complexity(false)
...
ipp.complexity(true)
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.
Nice catch, I'll go ahead and add something to check to see if the attribute exists and decide which function to use.
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.
@aplopez , I added another conditional, if the policy is empty. I had to update IPAObject.get() to return None and raise no errors if the results are empty.
3eab089
to
13eef9b
Compare
The tests are passing locally.
|
13eef9b
to
10992d0
Compare
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.
Going to put this on hold until after the holidays, but noted the changes I need to make when I get back.
"minclasses": (self.cli.option.VALUE, 5), | ||
"priority": (self.cli.option.VALUE, 1), | ||
} | ||
self._add(attrs) |
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.
Nice catch, I'll go ahead and add something to check to see if the attribute exists and decide which function to use.
10992d0
to
28fffdf
Compare
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.
The first pass mostly looks good. Just a small thing but, I want to try to setup and run the tests with this code to see how everything looks.
} | ||
self._add(attrs) | ||
else: | ||
_attrs: CLIBuilderArgs = { |
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.
Is there a need for _attrs
here vs attrs
in the conditional section above the else?
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.
This was a mypy complaint.
Found 1 error in 1 file (checked 46 source files)
sssd_test_framework/roles/ipa.py:1673: error: Name "attrs" already defined on line 1664 [no-redef]
lint-upstream: exit 1 (0.82 seconds) /home/dlavu/git/sssd-test-framework> mypy --install-types --non-interactive sssd_test_framework tests pid=692404
lint-upstream: FAIL ✖ in 3.71 seconds
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.
Would defining attrs
before the conditional as an empty dict solve this? It seems odd to have to define a new variable here.
FYI, with a couple of small modifications, all the tests pass locally for me:
|
* changed IPAObject.get() to return None if no results are found
28fffdf
to
252b248
Compare
Tests PR, SSSD/sssd#7728
This PR is larger than I expected.
misc.py
authentication.py
roles/ad.py, roles/ipa.py, roles/samba.py, roles/ldap.py
roles/generic.py