Skip to content

Conversation

@haocs
Copy link

@haocs haocs commented Sep 16, 2016

No description provided.

@azurecla
Copy link

Hi @haocs, I'm your friendly neighborhood Azure Pull Request Bot (You can call me AZPRBOT). Thanks for your contribution!


It looks like you're working at Microsoft (hach). If you're full-time, we DON'T require a contribution license agreement.



If you are a vendor, DO please sign the electronic contribution license agreement. It will take 2 minutes and there's no faxing! https://cla.azure.com.

TTYL, AZPRBOT;

@haocs
Copy link
Author

haocs commented Sep 16, 2016

Related issue: #905

@derekbekoe @yugangw-msft Please help review this PR, thanks!

@haocs haocs changed the title replaced pycurl with requests for webapp log [In Progress] replaced pycurl with requests for webapp log Sep 16, 2016
Copy link
Member

@derekbekoe derekbekoe left a 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 👍

Copy link
Member

@derekbekoe derekbekoe Sep 16, 2016

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.

@haocs haocs changed the title [In Progress] replaced pycurl with requests for webapp log Replaced pycurl with urllib3 in appservice web log stream Sep 21, 2016
c.perform()
import urllib3

urllib3.disable_warnings()
Copy link
Member

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?

Copy link
Author

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.

Copy link
Member

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...

Copy link
Author

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(
Copy link
Member

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?

Copy link
Author

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.

Copy link
Author

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()
Copy link
Member

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...

Copy link
Author

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?

@haocs
Copy link
Author

haocs commented Sep 22, 2016

@johanste @derekbekoe Please help review again, Thanks
@derekbekoe I specified urlib3 version for now, since the latest one breaks with py2.7

'azure-cli-core',
'azure-mgmt-web==0.30.0rc6',
'pycurl'
'urllib3==1.17'
Copy link
Member

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?

@derekbekoe
Copy link
Member

I'm fine with pinning to 1.16 for now

@mayurid mayurid changed the title Replaced pycurl with urllib3 in appservice web log stream [do not merge] Replaced pycurl with urllib3 in appservice web log stream Sep 22, 2016
@derekbekoe
Copy link
Member

Is this being merged in this morning?

@derekbekoe derekbekoe changed the title [do not merge] Replaced pycurl with urllib3 in appservice web log stream Replaced pycurl with urllib3 in appservice web log stream Sep 23, 2016
@derekbekoe derekbekoe merged commit 7ff60ef into Azure:master Sep 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants