-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Factor our service client creation [Finishes #114442535] [Finishes 114106051] [Finishes 114420495] #16
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
Merged
Merged
Factor our service client creation [Finishes #114442535] [Finishes 114106051] [Finishes 114420495] #16
Changes from 1 commit
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
6f6e19d
Factor our service client creation, except for login, which is the on…
BurtBiel 3a84edc
Code review feedback and added a test
BurtBiel 61b7575
casing change
BurtBiel 2287338
casing change
BurtBiel 42d5bd9
code review comments
BurtBiel 4b5287d
Add mock package for unit tests running on 2.7
BurtBiel 6266b37
merge master
BurtBiel a1742ad
merge master
BurtBiel 42cc671
add version to mock package
BurtBiel 2e85ba8
Add user agent string to HTTP headers
BurtBiel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| import os | ||
|
|
||
| def allow_debug_connection(client): | ||
| if should_allow_debug_connection(): | ||
| client.config.connection.verify = False | ||
|
|
||
| def should_allow_debug_connection(): | ||
| try: | ||
| return bool(os.environ['AllowDebug']) | ||
| except KeyError: | ||
| return False | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| from .._profile import Profile | ||
| import azure.cli._debug as _debug | ||
|
|
||
| def get_service_client(clientType, configType): | ||
| profile = Profile() | ||
| client = clientType(configType(*profile.get_login_credentials())) | ||
| _debug.allow_debug_connection(client) | ||
| return client |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
use get instead of try catch
change var name