Skip to content
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

Fix error in ca_cert_files validator #489

Closed
wants to merge 1 commit into from

Conversation

stlaz
Copy link
Contributor

@stlaz stlaz commented Feb 21, 2017

ClientInstall expects a single ca_cert_file as a string but the
framework gives it a list.

https://fedorahosted.org/freeipa/ticket/6694

ClientInstall expects a single ca_cert_file as a string but the
framework gives it a list.

https://fedorahosted.org/freeipa/ticket/6694
@@ -3555,6 +3555,10 @@ class ClientInstall(ClientInstallInterface,

@ca_cert_files.validator
def ca_cert_files(self, value):
if not isinstance(value, list):
Copy link
Member

Choose a reason for hiding this comment

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

Does it makes sense to check for len(value) == 1, too?

if not isinstance(value, list) or len(value) != 1:
    raise ValueError("Expected list of length 1, got {!r}".format(value))

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This check is performed in the option parser itself.

@tiran
Copy link
Member

tiran commented Feb 21, 2017

tentative ack, see comment

@tiran tiran added the ack Pull Request approved, can be merged label Feb 21, 2017
@MartinBasti
Copy link
Contributor

@MartinBasti MartinBasti added the pushed Pull Request has already been pushed label Feb 21, 2017
@stlaz stlaz deleted the cacert_validation branch September 11, 2017 10:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ack Pull Request approved, can be merged pushed Pull Request has already been pushed
Projects
None yet
3 participants