-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Replaced pycurl with urllib3 in appservice web log stream #907
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
Conversation
|
Hi @haocs, I'm your friendly neighborhood Azure Pull Request Bot (You can call me AZPRBOT). Thanks for your contribution!
TTYL, AZPRBOT; |
|
Related issue: #905 @derekbekoe @yugangw-msft Please help review this PR, thanks! |
derekbekoe
left a comment
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.
LGTM but would check with @yugangw-msft to make sure it behaves as intended. One less native dependency to deal with 👍
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.
Add from __future__ import print_function as the very first import.
Pylint is complaining in 2.7 because of this print statement.
| c.perform() | ||
| import urllib3 | ||
|
|
||
| urllib3.disable_warnings() |
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 do you need to disable warnings?
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.
urllibs generates SSL warnings that has nothing to do with webapp logs. So it's better to suppress those potential warnings.
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.
Which SSL warnings? Suppressing potential security related warnings is scary 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.
Fixed
| urllib3.disable_warnings() | ||
| http = urllib3.PoolManager() | ||
| headers = urllib3.util.make_headers(basic_auth='{0}:{1}'.format(user_name, password)) | ||
| r = http.request( |
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.
Don't you need to release the request at some point?
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.
stream request will be closed when client reads the end of content or server terminates 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.
Actually, I was wrong here. Added releasing connection here.
| import urllib3 | ||
|
|
||
| urllib3.disable_warnings() | ||
| http = urllib3.PoolManager() |
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.
We should make sure that we honor the "disable cert check" settings in order to support the use of network monitor/capture...
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. But in this case, do we expect our users take any action if they see those warnings?
|
@johanste @derekbekoe Please help review again, Thanks |
| 'azure-cli-core', | ||
| 'azure-mgmt-web==0.30.0rc6', | ||
| 'pycurl' | ||
| 'urllib3==1.17' |
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.
Think we should remove the pinned version here unless there's a requirement that we use this specific version?
|
I'm fine with pinning to 1.16 for now |
|
Is this being merged in this morning? |
No description provided.