Add profile switching params and profile listing command#2398
Add profile switching params and profile listing command#2398derekbekoe merged 6 commits intoAzure:api-profile-supportfrom
Conversation
- Modify ‘az cloud register’ and ‘az cloud update’ to include the ‘—profile’ parameter - Add ability to view all supported API versions without querying a cloud note: With this change, switching profile will not change anything as they are just example profiles.
Codecov Report
@@ Coverage Diff @@
## api-profile-support #2398 +/- ##
=======================================================
+ Coverage 72.33% 72.34% +0.01%
=======================================================
Files 323 325 +2
Lines 18273 18311 +38
Branches 2701 2707 +6
=======================================================
+ Hits 13217 13248 +31
- Misses 4223 4230 +7
Partials 833 833
Continue to review full report at Codecov.
|
yugangw-msft
left a comment
There was a problem hiding this comment.
Left 2 questions for clarifications. The rest LGTM
| c = Cloud(cloud_name) | ||
| for arg in cloud_args: | ||
| if arg == 'profile' and cloud_args[arg] is not None: | ||
| c.profile = cloud_args[arg] |
There was a problem hiding this comment.
Saw this pattern been used a few times. Can this if branch be moved out of the loop and become
c.profile = cloud_args.get('profile', None)There was a problem hiding this comment.
Yeah that works. Will change.
| except configparser.DuplicateSectionError: | ||
| if not overwrite: | ||
| raise CloudAlreadyRegisteredException(cloud.name) | ||
| if cloud.profile is not None: |
There was a problem hiding this comment.
do we need to differentiate between None and empty string? If yes, what does empty string imply?
There was a problem hiding this comment.
This is no longer needed. if cloud.profile is sufficient.
* Add profile switching and profile listing - Modify ‘az cloud register’ and ‘az cloud update’ to include the ‘—profile’ parameter - Add ability to view all supported API versions without querying a cloud note: With this change, switching profile will not change anything as they are just example profiles. * Fix pylint!! * Use ARM 'resource manager' endpoint if ASM 'management' endpoint not set * Fix pep8 * Fix hasattr() behaving differently in Python 3 * Code review changes
* Add profile switching and profile listing - Modify ‘az cloud register’ and ‘az cloud update’ to include the ‘—profile’ parameter - Add ability to view all supported API versions without querying a cloud note: With this change, switching profile will not change anything as they are just example profiles. * Fix pylint!! * Use ARM 'resource manager' endpoint if ASM 'management' endpoint not set * Fix pep8 * Fix hasattr() behaving differently in Python 3 * Code review changes
* Add profile switching and profile listing - Modify ‘az cloud register’ and ‘az cloud update’ to include the ‘—profile’ parameter - Add ability to view all supported API versions without querying a cloud note: With this change, switching profile will not change anything as they are just example profiles. * Fix pylint!! * Use ARM 'resource manager' endpoint if ASM 'management' endpoint not set * Fix pep8 * Fix hasattr() behaving differently in Python 3 * Code review changes
* Add profile switching and profile listing - Modify ‘az cloud register’ and ‘az cloud update’ to include the ‘—profile’ parameter - Add ability to view all supported API versions without querying a cloud note: With this change, switching profile will not change anything as they are just example profiles. * Fix pylint!! * Use ARM 'resource manager' endpoint if ASM 'management' endpoint not set * Fix pep8 * Fix hasattr() behaving differently in Python 3 * Code review changes
* Add profile switching and profile listing - Modify ‘az cloud register’ and ‘az cloud update’ to include the ‘—profile’ parameter - Add ability to view all supported API versions without querying a cloud note: With this change, switching profile will not change anything as they are just example profiles. * Fix pylint!! * Use ARM 'resource manager' endpoint if ASM 'management' endpoint not set * Fix pep8 * Fix hasattr() behaving differently in Python 3 * Code review changes
* Add profile switching and profile listing - Modify ‘az cloud register’ and ‘az cloud update’ to include the ‘—profile’ parameter - Add ability to view all supported API versions without querying a cloud note: With this change, switching profile will not change anything as they are just example profiles. * Fix pylint!! * Use ARM 'resource manager' endpoint if ASM 'management' endpoint not set * Fix pep8 * Fix hasattr() behaving differently in Python 3 * Code review changes
* Add profile switching and profile listing - Modify ‘az cloud register’ and ‘az cloud update’ to include the ‘—profile’ parameter - Add ability to view all supported API versions without querying a cloud note: With this change, switching profile will not change anything as they are just example profiles. * Fix pylint!! * Use ARM 'resource manager' endpoint if ASM 'management' endpoint not set * Fix pep8 * Fix hasattr() behaving differently in Python 3 * Code review changes
* Add profile switching and profile listing - Modify ‘az cloud register’ and ‘az cloud update’ to include the ‘—profile’ parameter - Add ability to view all supported API versions without querying a cloud note: With this change, switching profile will not change anything as they are just example profiles. * Fix pylint!! * Use ARM 'resource manager' endpoint if ASM 'management' endpoint not set * Fix pep8 * Fix hasattr() behaving differently in Python 3 * Code review changes
- Use published SDKs available on PyPI now - Loading versioned models for network and resources, object model initialization changes for 2015-* profile (#2812) - Custom ca certs - Setting Requests_ca_bundle environment variable (#2813) - changes for 2015-* profile to work against azure stack (#2794) - Loading versioned Resources client and versioned models in VM - Updating the supported api-versions for the 2015-example profile - Fixing network, compute sdk load errors for 2015-* profiles (+5 squashed commit) - Support multi-API versioned Storage dataplane SDK (#2796) - Support multi-versioned mgmt SDK (#2526) - Fix token "management" endpoint is being used in the place of "activeDirectoryResourceId" (#2410) - Add profile switching params and profile listing command (#2398) - Use ARM 'resource manager' endpoint if ASM 'management' endpoint not set
- Use published SDKs available on PyPI now - Loading versioned models for network and resources, object model initialization changes for 2015-* profile (#2812) - Custom ca certs - Setting Requests_ca_bundle environment variable (#2813) - changes for 2015-* profile to work against azure stack (#2794) - Loading versioned Resources client and versioned models in VM - Updating the supported api-versions for the 2015-example profile - Fixing network, compute sdk load errors for 2015-* profiles (+5 squashed commit) - Support multi-API versioned Storage dataplane SDK (#2796) - Support multi-versioned mgmt SDK (#2526) - Fix token "management" endpoint is being used in the place of "activeDirectoryResourceId" (#2410) - Add profile switching params and profile listing command (#2398) - Use ARM 'resource manager' endpoint if ASM 'management' endpoint not set
* API Profile Support - Use published SDKs available on PyPI now - Loading versioned models for network and resources, object model initialization changes for 2015-* profile (#2812) - Custom ca certs - Setting Requests_ca_bundle environment variable (#2813) - changes for 2015-* profile to work against azure stack (#2794) - Loading versioned Resources client and versioned models in VM - Updating the supported api-versions for the 2015-example profile - Fixing network, compute sdk load errors for 2015-* profiles (+5 squashed commit) - Support multi-API versioned Storage dataplane SDK (#2796) - Support multi-versioned mgmt SDK (#2526) - Fix token "management" endpoint is being used in the place of "activeDirectoryResourceId" (#2410) - Add profile switching params and profile listing command (#2398) - Use ARM 'resource manager' endpoint if ASM 'management' endpoint not set * Address code review feedback Fix pylint and pep8 (+7 squashed commits) Squashed commits: [f1d4d52] Refactor to use joint method [f43785a] Use generic method to get versioned SDK attributes [2100dd2] Add log debug if enum default not found [5767f41] Add single_placement_group back in for vmss [05ca8bc] Revert a test change. It has been fixed in master. [cdf4211] Simplify str override method [281c755] Clarify use of getattr * Fix patching the operation versions * Fix wrong import * Rename shared to _shared * Add message to cloud debug message * Remove public method ‘get_versioned_sdk_path’ from azure.cli.core.profiles * Remove unused import * Use setattr * Add API version comparisons * Add method docs * Fix failing test
note: With this change, switching profile will not change anything as they are just example profiles.
FYI @lmazuel For the
_shared.pyfile change. This would contain the resource type to api version map.Closes #2280
Closes #2279
Closes #2265