Skip to content
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

[Compute] Fix #30009: az vm install-patches: Fix errors due to typos in install_patches function #30011

Merged
merged 8 commits into from
Nov 27, 2024

Conversation

Dxaz
Copy link
Contributor

@Dxaz Dxaz commented Sep 30, 2024

Fix #30009

Related command

az vm install-patches

Description

Install_patches has paramerters with typos and throw the following error: Error given: kb_numbers_to_inclunde is not a known attribute of class <class 'azure.mgmt.compute.v2024_03_01.models._models_py3.WindowsParameters'> and will be ignored

exclude_kbs_requirig_reboot is not a known attribute of class <class 'azure.mgmt.compute.v2024_03_01.models._models_py3.WindowsParameters'> and will be ignored

Parameters should be kb_numbers_to_include and exclude_kbs_requiring_reboot respectively

Original pull request containing typos:
3a5091e

Testing Guide

az vm install-patches --resource-group myResourceGroup --name myVM --maximum-duration PT4H --reboot-setting IfRequired

gives error:
kb_numbers_to_inclunde is not a known attribute of class <class 'azure.mgmt.compute.v2024_07_01.models._models_py3.WindowsParameters'> and will be ignored

exclude_kbs_requirig_reboot is not a known attribute of class <class 'azure.mgmt.compute.v2024_07_01.models._models_py3.WindowsParameters'> and will be ignored

History Notes

[Compute] Fix issue #30009 : az vm install-patches: fix errors

Install_patches has paramerters with typos and throw the following error: Error given: kb_numbers_to_inclunde is not a known attribute of class <class 'azure.mgmt.compute.v2024_03_01.models._models_py3.WindowsParameters'> and will be ignored exclude_kbs_requirig_reboot is not a known attribute of class <class 'azure.mgmt.compute.v2024_03_01.models._models_py3.WindowsParameters'> and will be ignored Parameters should be kb_numbers_to_include and exclude_kbs_requiring_reboot respectively
Copy link

azure-client-tools-bot-prd bot commented Sep 30, 2024

️✔️AzureCLI-FullTest
️✔️acr
️✔️2020-09-01-hybrid
️✔️3.12
️✔️3.9
️✔️latest
️✔️3.12
️✔️3.9
️✔️acs
️✔️2020-09-01-hybrid
️✔️3.12
️✔️3.9
️✔️latest
️✔️3.12
️✔️3.9
️✔️advisor
️✔️latest
️✔️3.12
️✔️3.9
️✔️ams
️✔️latest
️✔️3.12
️✔️3.9
️✔️apim
️✔️latest
️✔️3.12
️✔️3.9
️✔️appconfig
️✔️latest
️✔️3.12
️✔️3.9
️✔️appservice
️✔️latest
️✔️3.12
️✔️3.9
️✔️aro
️✔️latest
️✔️3.12
️✔️3.9
️✔️backup
️✔️latest
️✔️3.12
️✔️3.9
️✔️batch
️✔️latest
️✔️3.12
️✔️3.9
️✔️batchai
️✔️latest
️✔️3.12
️✔️3.9
️✔️billing
️✔️latest
️✔️3.12
️✔️3.9
️✔️botservice
️✔️latest
️✔️3.12
️✔️3.9
️✔️cdn
️✔️latest
️✔️3.12
️✔️3.9
️✔️cloud
️✔️latest
️✔️3.12
️✔️3.9
️✔️cognitiveservices
️✔️latest
️✔️3.12
️✔️3.9
️✔️compute_recommender
️✔️latest
️✔️3.12
️✔️3.9
️✔️computefleet
️✔️latest
️✔️3.12
️✔️3.9
️✔️config
️✔️latest
️✔️3.12
️✔️3.9
️✔️configure
️✔️latest
️✔️3.12
️✔️3.9
️✔️consumption
️✔️latest
️✔️3.12
️✔️3.9
️✔️container
️✔️latest
️✔️3.12
️✔️3.9
️✔️containerapp
️✔️latest
️✔️3.12
️✔️3.9
️✔️core
️✔️2018-03-01-hybrid
️✔️3.12
️✔️3.9
️✔️2019-03-01-hybrid
️✔️3.12
️✔️3.9
️✔️2020-09-01-hybrid
️✔️3.12
️✔️3.9
️✔️latest
️✔️3.12
️✔️3.9
️✔️cosmosdb
️✔️latest
️✔️3.12
️✔️3.9
️✔️databoxedge
️✔️2019-03-01-hybrid
️✔️3.12
️✔️3.9
️✔️2020-09-01-hybrid
️✔️3.12
️✔️3.9
️✔️latest
️✔️3.12
️✔️3.9
️✔️dls
️✔️latest
️✔️3.12
️✔️3.9
️✔️dms
️✔️latest
️✔️3.12
️✔️3.9
️✔️eventgrid
️✔️latest
️✔️3.12
️✔️3.9
️✔️eventhubs
️✔️latest
️✔️3.12
️✔️3.9
️✔️feedback
️✔️latest
️✔️3.12
️✔️3.9
️✔️find
️✔️latest
️✔️3.12
️✔️3.9
️✔️hdinsight
️✔️latest
️✔️3.12
️✔️3.9
️✔️identity
️✔️latest
️✔️3.12
️✔️3.9
️✔️iot
️✔️2019-03-01-hybrid
️✔️3.12
️✔️3.9
️✔️2020-09-01-hybrid
️✔️3.12
️✔️3.9
️✔️latest
️✔️3.12
️✔️3.9
️✔️keyvault
️✔️2018-03-01-hybrid
️✔️3.12
️✔️3.9
️✔️2020-09-01-hybrid
️✔️3.12
️✔️3.9
️✔️latest
️✔️3.12
️✔️3.9
️✔️lab
️✔️latest
️✔️3.12
️✔️3.9
️✔️managedservices
️✔️latest
️✔️3.12
️✔️3.9
️✔️maps
️✔️latest
️✔️3.12
️✔️3.9
️✔️marketplaceordering
️✔️latest
️✔️3.12
️✔️3.9
️✔️monitor
️✔️latest
️✔️3.12
️✔️3.9
️✔️mysql
️✔️latest
️✔️3.12
️✔️3.9
️✔️netappfiles
️✔️latest
️✔️3.12
️✔️3.9
️✔️network
️✔️2018-03-01-hybrid
️✔️3.12
️✔️3.9
️✔️latest
️✔️3.12
️✔️3.9
️✔️policyinsights
️✔️latest
️✔️3.12
️✔️3.9
️✔️privatedns
️✔️latest
️✔️3.12
️✔️3.9
️✔️profile
️✔️latest
️✔️3.12
️✔️3.9
️✔️rdbms
️✔️latest
️✔️3.12
️✔️3.9
️✔️redis
️✔️latest
️✔️3.12
️✔️3.9
️✔️relay
️✔️latest
️✔️3.12
️✔️3.9
️✔️resource
️✔️2018-03-01-hybrid
️✔️3.12
️✔️3.9
️✔️2019-03-01-hybrid
️✔️3.12
️✔️3.9
️✔️latest
️✔️3.12
️✔️3.9
️✔️role
️✔️latest
️✔️3.12
️✔️3.9
️✔️search
️✔️latest
️✔️3.12
️✔️3.9
️✔️security
️✔️latest
️✔️3.12
️✔️3.9
️✔️servicebus
️✔️latest
️✔️3.12
️✔️3.9
️✔️serviceconnector
️✔️latest
️✔️3.12
️✔️3.9
️✔️servicefabric
️✔️latest
️✔️3.12
️✔️3.9
️✔️signalr
️✔️latest
️✔️3.12
️✔️3.9
️✔️sql
️✔️latest
️✔️3.12
️✔️3.9
️✔️sqlvm
️✔️latest
️✔️3.12
️✔️3.9
️✔️storage
️✔️2018-03-01-hybrid
️✔️3.12
️✔️3.9
️✔️2019-03-01-hybrid
️✔️3.12
️✔️3.9
️✔️2020-09-01-hybrid
️✔️3.12
️✔️3.9
️✔️latest
️✔️3.12
️✔️3.9
️✔️synapse
️✔️latest
️✔️3.12
️✔️3.9
️✔️telemetry
️✔️2018-03-01-hybrid
️✔️3.12
️✔️3.9
️✔️2019-03-01-hybrid
️✔️3.12
️✔️3.9
️✔️2020-09-01-hybrid
️✔️3.12
️✔️3.9
️✔️latest
️✔️3.12
️✔️3.9
️✔️util
️✔️latest
️✔️3.12
️✔️3.9
️✔️vm
️✔️2018-03-01-hybrid
️✔️3.12
️✔️3.9
️✔️2019-03-01-hybrid
️✔️3.12
️✔️3.9
️✔️2020-09-01-hybrid
️✔️3.12
️✔️3.9
️✔️latest
️✔️3.12
️✔️3.9

Copy link

azure-client-tools-bot-prd bot commented Sep 30, 2024

️✔️AzureCLI-BreakingChangeTest
️✔️Non Breaking Changes

@yonzhan
Copy link
Collaborator

yonzhan commented Sep 30, 2024

Compute

@microsoft-github-policy-service microsoft-github-policy-service bot added the Auto-Assign Auto assign by bot label Sep 30, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the Compute az vm/vmss/image/disk/snapshot label Sep 30, 2024
@Dxaz Dxaz changed the title [Compute] Fix issue 30009: az vm install-patches fix errors due to typos in install_patches function. [Compute] Fix issue 30009: az vm install-patches fix errors due to typos in install_patches function Sep 30, 2024
@Dxaz Dxaz marked this pull request as ready for review September 30, 2024 22:18
@Dxaz
Copy link
Contributor Author

Dxaz commented Oct 15, 2024

Updated title, team do we have any updates on this?

@yonzhan
Copy link
Collaborator

yonzhan commented Oct 15, 2024

Please fix CI issues

@Dxaz Dxaz marked this pull request as draft October 25, 2024 14:11
@Dxaz Dxaz marked this pull request as ready for review October 25, 2024 14:11
@Dxaz
Copy link
Contributor Author

Dxaz commented Oct 25, 2024

Please fix CI issues

Fixed

@zhoxing-ms zhoxing-ms changed the title [Compute] Fix issue 30009: az vm install-patches fix errors due to typos in install_patches function [Compute] Fix #30009: az vm install-patches: Fix errors due to typos in install_patches function Oct 28, 2024
@zhoxing-ms
Copy link
Contributor

@Dxaz Could you please add some tests for these cases?

@yanzhudd
Copy link
Contributor

Please note that Azure CLI will have a code freeze at 10/29/2024 10:00 UTC for the upcoming release. Please resolve the comments ASAP if you want to catch the release train, otherwise the PR has to be postponed to next sprint (11-19).

@Dxaz
Copy link
Contributor Author

Dxaz commented Oct 29, 2024

@Dxaz Could you please add some tests for these cases?

Done.

Please note that Azure CLI will have a code freeze at 10/29/2024 10:00 UTC for the upcoming release. Please resolve the comments ASAP if you want to catch the release train, otherwise the PR has to be postponed to next sprint (11-19).

I understand.

zhoxing-ms
zhoxing-ms previously approved these changes Oct 29, 2024
@zhoxing-ms
Copy link
Contributor

image

@Dxaz Could you please resolve this CI issue?

@Dxaz
Copy link
Contributor Author

Dxaz commented Oct 29, 2024

Theres a specific issue with python 3.9.20. Let me investigate further.

@Dxaz
Copy link
Contributor Author

Dxaz commented Oct 29, 2024

image

@Dxaz Could you please resolve this CI issue?

unittest > case.py TestCase class has no assertNoLogs method in 3.9.20. So this testcase cannot be made for this scenario. Since the error in question for this PR is a log level warning thrown by azure.mgmt.compute._serialization.

I cannot make an assertion for this scenario in python 3.9.20. Any thoughts @zhoxing-ms?

Comment on lines 10352 to 10362
# Test for WindowsParameters and check for serialization warning/errors
with self.assertNoLogs(logger='azure.mgmt.compute._serialization', level='WARNING'):
self.cmd('vm install-patches -g {rg} -n vm --maximum-duration PT4H --reboot-setting IfRequired --classifications-to-include-win Critical Security --exclude-kbs-requiring-reboot true --max-patch-publish-date 2024-11-01T02:36:43', checks=[
self.check('status', 'Succeeded')
])

# Test for LinuxParameters and check for serialization warning/errors
with self.assertNoLogs(logger='azure.mgmt.compute._serialization', level='WARNING'):
self.cmd('vm install-patches -g {rg} -n vm2 --maximum-duration PT4H --reboot-setting Never --classifications-to-include-linux Other', checks=[
self.check('status', 'Succeeded')
])
Copy link
Contributor

@zhoxing-ms zhoxing-ms Oct 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Dxaz I suggest that we should verify that the relevant features can work properly after correcting these parameters, rather than verifying that there are no warning logs

@pl-andykalman
Copy link

Hello - We're keen to see this issue fixed. Since Azure Update Manager has been introduced we're using more of these CLI commands to manage patching operations. Our pipeline for Windows is on hold and using an older version is not a possibility as the typos have existed for too long.

Will this be released in November by chance???

@zhoxing-ms
Copy link
Contributor

@Dxaz Could you please resolve these comments and CI issues?

@zhoxing-ms
Copy link
Contributor

zhoxing-ms commented Nov 13, 2024

Will this be released in November by chance???

@pl-andykalman Sorry, due to the CI issues and comments of this PR not being resolved in a timely manner, it will not be able to catch up with the release in November. @Dxaz Please try to complete it before the release for December

@Dxaz
Copy link
Contributor Author

Dxaz commented Nov 22, 2024

Hey Team, sorry for the delay, I will work on this asap

@Dxaz
Copy link
Contributor Author

Dxaz commented Nov 23, 2024

@zhoxing-ms updated the tests, now I'm just waiting for CI to run and complete

@Dxaz
Copy link
Contributor Author

Dxaz commented Nov 26, 2024

@zhoxing-ms when you have an opportunity may you approve the changes, please?

@zhoxing-ms
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@zhoxing-ms zhoxing-ms merged commit 064c250 into Azure:dev Nov 27, 2024
53 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Assign Auto assign by bot Compute az vm/vmss/image/disk/snapshot Installation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

az vm install-patches gives error regarding --kb-numbers-to-include and --exclude-kbs-requiring-reboot
6 participants