-
Notifications
You must be signed in to change notification settings - Fork 243
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
Replace WMIC with powershell cmd #4034
base: master
Are you sure you want to change the base?
Conversation
97073f0
to
194ab37
Compare
1c9d9ea
to
7c4813a
Compare
ae6028c
to
9f86791
Compare
From Win11-24H2, WMIC is an optional feature for Windows, And it will be fully removed in the future.So replace the related cmd Signed-off-by: Leidong Wang <leidwang@redhat.com>
9f86791
to
d1bcda5
Compare
Test 271 acceptance with win2022,win11,win1032 and win2016 guests, this patch worked. |
Hi @XueqiangWei @nanliu-r @fbq815 Would you please help test this MR, it is mainly for wmic repalcement.Thanks. |
Acceptance test looks good. |
balloon_hotplug test cases now passed in Win2025
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Hi @yanan-fu @YongxueHong Would you please help review this MR?Thanks. |
return out if out else [] | ||
c_name, c_value = cond.split("=") | ||
cmd = ( | ||
'powershell -command "Get-CimInstance -ClassName Win32_LogicalDisk | Where-Object {$_.%s -like %s}' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The disk needs to be under single quotes, same you've done in utils_netperf.py and replace the existing ones by double quotes
'powershell -command "Get-CimInstance -ClassName Win32_LogicalDisk | Where-Object {$_.%s -like %s}' | |
"powershell -command \"Get-CimInstance -ClassName Win32_LogicalDisk | Where-Object {$_.%s -like '%s'}" |
return mapping | ||
return {} | ||
cmd = ( | ||
'powershell -command "Get-CimInstance -ClassName Win32_Diskdrive | Where-Object {$_.SerialNumber -eq %s}' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above
'powershell -command "Get-CimInstance -ClassName Win32_Diskdrive | Where-Object {$_.SerialNumber -eq %s}' | |
"powershell -command \"Get-CimInstance -ClassName Win32_Diskdrive | Where-Object {$_.SerialNumber -eq '%s'}" |
results.append(vals[0]) | ||
else: | ||
results.append(dict(zip(keys, vals))) | ||
return results if results else [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@leidwang
Another comment here, this implementation seems to no longer return a map, so this will probably break all the calls to this function.
From Win11-24H2, WMIC is an optional feature for Windows, And it will be fully removed in the future.So replace the related cmd
ID: 3268