-
Notifications
You must be signed in to change notification settings - Fork 25
New option to ignore ssl verification of Jenkins server #27
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
base: master
Are you sure you want to change the base?
Conversation
jenkins_cli/cli.py
Outdated
|
|
||
| # Default constants to parse booleans from .jenkins-cli | ||
| TRUE = ['yes', 'Yes', 'YES', 'True', 'true', 'TRUE', '1'] | ||
| FALSE = ['no', 'No', 'NO', 'False', 'false', 'FALSE', '0'] |
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.
Looks like FALSE is not used anywhere. I think we do not need it.
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.
Ok, I agree with you.
|
|
||
|
|
||
| # Default constants to parse booleans from .jenkins-cli | ||
| TRUE = ['yes', 'Yes', 'YES', 'True', 'true', 'TRUE', '1'] |
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 think if ignore_ssl= option is in .jencins-cli file, that means that we do want to ignore ssl errors. So I think we do not need TRUE constant as well.
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.
Well, I think it will be very weird if someone configures this property like this: ignore_ssl=False and the application continue ignoring SSL errors.
That's why I thought it would be a good idea to configure a list with all acceptable strings.
ignore_ssl= also seems strange to me. What do you think?
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 agree that ignore_ssl=False may looks a bit strange. But the list with all acceptable strings looks strange also.
Maybe it will be enough to define behavior in help section?
Something like:
"You can set ignore_ssl in settings file. Any value will be treated as True unless it equals 0"
or
"You can set ignore_ssl=1 in settings file if you want to ignore ssl erros. All other values will be treated as False"
We need to document this option anyway and its hardy possible to find all acceptable strings (for example we can also add 'y' and 'Y')
What do you think?
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 agree, any case scenario this should be documented on both README.md and --help.
We could document that the user should set ignore_ssl=yes and all other cases will be treated as False and still have the list.
If we decide to accept only one option the comparison will be pretty much the same:
List:
cls.ignore_ssl = ignore_ssl or settings_dict.get('ignore_ssl', 'False') in TRUESingle accepted pattern:
cls.ignore_ssl = ignore_ssl or settings_dict.get('ignore_ssl', 'False') == '1'BTW, I was inspired by ansible when I wrote this list. They pretty much have the same problem, reading config and transforming what it seems to be boolean into python bool.
|
Hello @bernardoVale thank you for the PR. |
|
Hey @LD250, I've fixed the I've just checked using your master branch, check the error: It's an ssl error while downloading |
I will check this today later |
|
@bernardoVale I have merged Travis build fix to master branch. I also removed python3.5 from |
|
Merging this would be appreciated, for now I hardcoded the context creation into run_command and it works :) |
|
PR is a bit outdated. Conflicts should be resolved before merge. |
|
@LD250 I will rebase master. |
For folks like me, that still has to deal with self-signed certificates :)
This fixes the issue #26.