Repository navigation
Fix Azure backend setup after Azure SDK package bump - #1452
Open
sparcstation wants to merge 1 commit into
Open
sparcstation wants to merge 1 commit into
sparcstation wants to merge 1 commit into
Conversation
…age 25 The package bump (splunk#1445) broke Azure builds in two ways: - azure-mgmt-resource >= 24 no longer exports ResourceManagementClient from azure.mgmt.resource; import it from azure.mgmt.resource.resources. The swallowed ImportError set AZURE_AVAILABLE=False and surfaced as a misleading 'Azure SDK not available' error. - azure-mgmt-storage >= 25 models are MutableMappings, so list_keys().keys is the dict method ('method' object is not subscriptable). Read the key list via a helper that supports both model styles. Also include the underlying ImportError in the 'SDK not available' warning and add regression tests.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
The package bump in #1445 broke Azure range builds at the remote-backend step:
azure-mgmt-resource26.0.0 no longer exportsResourceManagementClientfromazure.mgmt.resource(it lives inazure.mgmt.resource.resources). TheImportErrorwas swallowed by the guarded import block, settingAZURE_AVAILABLE = False, so builds failed with the misleading:azure-mgmt-storage25.x models areMutableMappings, solist_keys(...).keysresolves to the dict.keys()method:sys.exit(1)inside the API build thread, leaving the range stuck atbuild_vpnindefinitely.Changes
ResourceManagementClientfromazure.mgmt.resource.resources, falling back to the old path for older SDKs._first_storage_key()helper that reads the key list from both dict-like (new) and attribute-only (old msrest) models.ImportErrorin the "Azure SDK not available" warning so future regressions are diagnosable.tests/test_azure_provider.pyregression tests.Testing
develop.pytest -m "not e2e") in theapi/Dockerfileimage: 62 passed. The one pre-existing failure (test_cisco_fmc_ftd.py::test_cisco_template_builds_splunk_then_fmc, missingtemplates/aws/cisco_fmc_ftd_aws.yml) is unrelated and also fails ondevelop.azure/splunk_ad_azurevia Docker Compose; backend creation, Terraform, VPN and lab phases completed. (The lab phase additionally required a fix in theP4T12ICK.ar_domain_controllerrole, submitted separately.)