Conversation
…ror: 'NoneType' object has no attribute 'smb'`
|
Storage |
jiasli
left a comment
There was a problem hiding this comment.
I don't think this PR is a good idea.
If we implement this check, we should implement checks for all object properties, like this protocolSettings or shareDeleteRetentionPolicy, just in case they are suddenly missing from the API's response.
> az storage account file-service-properties show -n clitest23zhehg2ug7pzcmmt
{
"cors": {
"corsRules": []
},
"id": "/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/clitest47xrljy3nijo3qd5vzsdilpqy5gmhc6vhrxdt4iznh6uaopskftgp4scam2w7drpot4l/providers/Microsoft.Storage/storageAccounts/clitest23zhehg2ug7pzcmmt/fileServices/default",
"name": "default",
"protocolSettings": null,
"resourceGroup": "clitest47xrljy3nijo3qd5vzsdilpqy5gmhc6vhrxdt4iznh6uaopskftgp4scam2w7drpot4l",
"shareDeleteRetentionPolicy": {
"allowPermanentDelete": null,
"days": 0,
"enabled": false
},
"sku": {
"name": "Standard_LRS",
"tier": "Standard"
},
"type": "Microsoft.Storage/storageAccounts/fileServices"
}
Also, after API fixes this, the check for protocolSettings will be rendered useless.
|
This PR reminds me of #17526 where |
If we want to update sub property of
Service won't "fix" API. They think return
We should do essential checks to make sure our product doesn't break frequently. That's quality requirements for our own product. We can't rely on the quality of external input. |
Then we need to be prepared that any object property can be I approved the PR, but I keep my personal opinion. |
|
/azp run |
|
Azure Pipelines successfully started running 2 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 2 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 2 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 2 pipeline(s). |
Related command
az storage account file-service-properties updateDescription
Fix #22679 , IcM 311511171
update_file_service_propertiescan't handle properly wheninstance.protocol_settingsisNone.Previously
get_file_service_propertieswould get response"protocolSettings":{"smb":{}}from server.But recently server won't return
"protocalSettings"property any more.Then CLI would crash with
AttributeError: 'NoneType' object has no attribute 'smb'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.