New option to ignore ssl verification of Jenkins server - #27
New option to ignore ssl verification of Jenkins server#27bernardoVale wants to merge 2 commits into
Conversation
| # 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.
Looks like FALSE is not used anywhere. I think we do not need it.
| # Default constants to parse booleans from .jenkins-cli | ||
| TRUE = ['yes', 'Yes', 'YES', 'True', 'true', 'TRUE', '1'] |
There was a problem hiding this comment.
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.
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.
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.
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_sslorsettings_dict.get('ignore_ssl', 'False') inTRUESingle accepted pattern:
cls.ignore_ssl=ignore_sslorsettings_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. |
bernardoVale
commented
Apr 23, 2017
Hey @LD250, I've fixed the I've just checked using your master branch, check the error: It's an ssl error while downloading |
LD250
commented
Apr 23, 2017
I will check this today later |
LD250
commented
May 12, 2017
@bernardoVale I have merged Travis build fix to master branch. I also removed python3.5 from |
djetelina
commented
Aug 30, 2017
Merging this would be appreciated, for now I hardcoded the context creation into run_command and it works :) |
LD250
commented
Aug 30, 2017
PR is a bit outdated. Conflicts should be resolved before merge. |
bernardoVale
commented
Aug 30, 2017
@LD250 I will rebase master. |
For folks like me, that still has to deal with self-signed certificates :)
This fixes the issue #26.