Skip to content

[Interactive] Remove dependency of ENV_ADDITIONAL_USER_AGENT#1479

Merged
jiasli merged 3 commits intoAzure:masterfrom
jiasli:interactive
Apr 2, 2020
Merged

[Interactive] Remove dependency of ENV_ADDITIONAL_USER_AGENT#1479
jiasli merged 3 commits intoAzure:masterfrom
jiasli:interactive

Conversation

@jiasli
Copy link
Member

@jiasli jiasli commented Apr 1, 2020

Fix #1480: az interactive crashes with "cannot import name 'ENV_ADDITIONAL_USER_AGENT'"

This issue is introduced by Azure/azure-cli#12734 which removed the redundant logic of ENV_ADDITIONAL_USER_AGENT, because it is already taken care of by msrest.

This PR removes the dependency of AZURE_HTTP_USER_AGENT and hard-codes it because msrest doesn't expose it:

https://github.com/Azure/msrest-for-python/blob/4cc8bc84e96036f03b34716466230fb257e27b36/msrest/pipeline/universal.py#L70

class UserAgentPolicy(SansIOHTTPPolicy):
    _USERAGENT = "User-Agent"
    _ENV_ADDITIONAL_USER_AGENT = 'AZURE_HTTP_USER_AGENT'

This checklist is used to make sure that common guidelines for a pull request are followed.

General Guidelines

  • Have you run azdev style <YOUR_EXT> locally? (pip install azdev required)
  • Have you run python scripts/ci/test_index.py -q locally?

For new extensions:

About Extension Publish

There is a pipeline to automatically build, upload and publish extension wheels.
Once your PR is merged into master branch, a new PR will be created to update src/index.json automatically.
The precondition is to put your code inside this repo and upgrade the version in the PR but do not modify src/index.json.

@jiasli jiasli changed the title Remove dependency of ENV_ADDITIONAL_USER_AGENT [Interactive] Remove dependency of ENV_ADDITIONAL_USER_AGENT Apr 1, 2020
@yonzhan yonzhan added this to the S168 milestone Apr 1, 2020
@yonzhan
Copy link
Collaborator

yonzhan commented Apr 1, 2020

add to S168

@jiasli jiasli merged commit f7f9ca9 into Azure:master Apr 2, 2020
@jiasli jiasli deleted the interactive branch April 3, 2020 02:18
ManuInNZ pushed a commit to ManuInNZ/azure-cli-extensions that referenced this pull request Apr 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

az interactive crashes with "cannot import name 'ENV_ADDITIONAL_USER_AGENT'"

4 participants