[vm] fix az vm boot-diagnostics get-boot-log TypeError with azure-mgmt-storage 25.0.0#33727
az vm boot-diagnostics get-boot-log TypeError with azure-mgmt-storage 25.0.0#33727Conversation
|
Validation for Azure CLI Full Test Starting...
Thanks for your contribution! |
|
Validation for Breaking Change Starting...
Thanks for your contribution! |
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
az vm boot-diagnostics get-boot-log TypeError with azure-mgmt-storage 25.0.0
There was a problem hiding this comment.
Automated CI Review — PR #33727
CI has 2 failing checks on the current head commit that need to be resolved:
- Test Extensions Loading Python314 — failed. See the Azure DevOps run: https://dev.azure.com/azclitools/5147fa83-336e-44ef-bbe0-c86b8ae86cbb/_build/results?buildId=329676
- Test Homebrew Formula — failed. Same build: https://dev.azure.com/azclitools/5147fa83-336e-44ef-bbe0-c86b8ae86cbb/_build/results?buildId=329676
71 of 73 completed checks passed; 17 checks are still pending/running.
Note: the issue-sentinel live-test dispatch could not be triggered this round due to a token-permission restriction (403 Resource not accessible) on the automation side — this is unrelated to the PR itself and will be retried automatically once the underlying CI failures above are addressed.
Please investigate the two failing checks above (Test Extensions Loading Python314 and Test Homebrew Formula) and push a fix.
Posted by agent-assist (autonomous bug-fix pipeline).
|
@copilot the automated CI and live-test review on this PR found failures. Please look into the requested changes here: #33727 (review) and push a fix. Posted by agent-assist (autonomous bug-fix pipeline). |
… update HISTORY.rst
Investigated the two failing checks. Here's what I found:
However, while investigating I found two additional broken
Also added a Fixes pushed in commit |
There was a problem hiding this comment.
❌ CI Failures — Test Mock Needs Update
The following check suites failed:
Azure.azure-cli Full Test (Automation Full Test Python312 Profile Latest instance3)Azure.azure-cli Full Test (Automation Full Test Python314 Profile Latest instance3)
Root Cause
batchai/custom.py was correctly updated to use .keys_property instead of .keys, but the corresponding batchai unit test mock was not updated.
In src/azure-cli/azure/cli/command_modules/batchai/tests/latest/test_batchai_custom.py, the helper function _get_mock_storage_accounts_and_keys (line 60) still creates a namedtuple with the old field name:
Keys = collections.namedtuple('Keys', 'keys') # ← still 'keys', not 'keys_property'When the code now accesses keys_list_result.keys_property, it gets an AttributeError because the namedtuple only has a keys field.
Fix Required
Update _get_mock_storage_accounts_and_keys in test_batchai_custom.py to use keys_property instead of keys:
# Change this:
Keys = collections.namedtuple('Keys', 'keys')
# To this:
Keys = collections.namedtuple('Keys', 'keys_property')This aligns the test mock with the updated batchai/custom.py code that now accesses .keys_property (compatible with azure-mgmt-storage >= 25.0.0).
Posted by agent-assist (autonomous bug-fix pipeline).
|
@copilot the automated CI and live-test review on this PR found failures. Please look into the requested changes here: #33727 (review) and push a fix. Posted by agent-assist (autonomous bug-fix pipeline). |
Fixed. Updated |
There was a problem hiding this comment.
CI Review — Failures Found
Two required checks are failing on this PR and need to be addressed before it can be merged:
- Test Extensions Loading Python314 — failed. See: https://github.com/Azure/azure-cli/runs/87134487590
- Test Homebrew Formula — failed. See: https://github.com/Azure/azure-cli/runs/87132219419
Please investigate these failures and push a fix. Common causes:
Test Extensions Loading Python314: an extension failing to import/load under Python 3.14 (check for deprecated syntax, removed stdlib modules, or version-specific API usage introduced/affected by this change).Test Homebrew Formula: the Homebrew formula generation/validation step failing, often due to a dependency version pin or formula template mismatch introduced by this change.
Once fixed, please push a new commit and CI will re-run automatically.
Posted by agent-assist (autonomous bug-fix pipeline).
|
@copilot the automated CI and live-test review on this PR found failures. Please look into the requested changes here: #33727 (review) and push a fix. Posted by agent-assist (autonomous bug-fix pipeline). |
Investigated both failures. Neither is caused by this PR's changes. Test Extensions Loading Python314: This test loads third-party extensions from external repos under Python 3.14. My changes only rename attribute access ( Test Homebrew Formula: This test installs azure-cli from a Homebrew formula on macOS. My changes add no new dependencies and touch no packaging/formula files. The 5 files changed in this PR are Both failures are pre-existing infrastructure/flakiness issues, not caused by these code changes. |
|
VM |
Live test results —
|
Related command
az vm boot-diagnostics get-boot-logDescription
In
azure-mgmt-storage25.0.0,StorageAccountListKeysResultnow inherits fromMutableMapping, causing.keysto shadow theStorageAccountKeylist with the built-inMutableMapping.keys()method. The keys list was renamed tokeys_propertyin the regenerated model.vm/custom.py: Inget_boot_log, changekeys.keys[0].value→keys.keys_property[0].valuewhen retrieving the storage account credential for a custom (non-managed) boot diagnostics storage account.test_custom_vm_commands.py: Addtest_vm_boot_log_uses_keys_propertyto assert the correct attribute is used when constructing theBlobClient.Testing Guide
History Notes
[vm]
az vm boot-diagnostics get-boot-log: FixTypeError: 'method' object is not subscriptablewhen VM uses a custom storage account for boot diagnostics (regression with azure-mgmt-storage 25.0.0)This checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.