* Mon Jul 10 2023 Miroslav Rezanina <mrezanin@redhat.com> - 0-1.41.20190303git

- hpvd-vmbus_testing-fix-wrong-python-syntax-for-integer-va.patch [bz#2218931]
- Resolves: bz#2218931
  ([Hyper-V] [RHEL-9] /usr/sbin/vmbus_testing python script prints: "SyntaxWarning: "is" with a literal.")
This commit is contained in:
Miroslav Rezanina 2023-07-10 04:56:27 -04:00
parent cc935bb462
commit 20345eb4c1
2 changed files with 61 additions and 1 deletions

View File

@ -0,0 +1,52 @@
From 21261cb75d523dd3ac815524e66f53694c1a3c2a Mon Sep 17 00:00:00 2001
From: Ani Sinha <anisinha@redhat.com>
Date: Wed, 5 Jul 2023 18:44:34 +0530
Subject: [PATCH] vmbus_testing: fix wrong python syntax for integer value
comparison
RH-Author: Ani Sinha <None>
RH-MergeRequest: 6: vmbus_testing: fix wrong python syntax for interger value comparison
RH-Bugzilla: 2218931
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
RH-Commit: [1/1] 2887e0ad51a16a499ebdeac29f3086c8be481e0c (anisinha/centos-hyperv-daemons)
It is incorrect in python to compare integer values using the "is" keyword. The
"is" keyword in python is used to compare references to two objects, not their
values. Newer version of python3 (version 3.8) throws a warning when such
incorrect comparison is made. For value comparison, "==" should be used.
Fix this in the code and suppress the following warning:
/usr/sbin/vmbus_testing:167: SyntaxWarning: "is" with a literal. Did you mean "=="?
RHBZ: 2218931
Signed-off-by: Ani Sinha <anisinha@redhat.com>
---
vmbus_testing | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/vmbus_testing b/vmbus_testing
index e721290..4467979 100755
--- a/vmbus_testing
+++ b/vmbus_testing
@@ -164,7 +164,7 @@ def recursive_file_lookup(path, file_map):
def get_all_devices_test_status(file_map):
for device in file_map:
- if (get_test_state(locate_state(device, file_map)) is 1):
+ if (get_test_state(locate_state(device, file_map)) == 1):
print("Testing = ON for: {}"
.format(device.split("/")[5]))
else:
@@ -203,7 +203,7 @@ def write_test_files(path, value):
def set_test_state(state_path, state_value, quiet):
write_test_files(state_path, state_value)
- if (get_test_state(state_path) is 1):
+ if (get_test_state(state_path) == 1):
if (not quiet):
print("Testing = ON for device: {}"
.format(state_path.split("/")[5]))
--
2.39.3

View File

@ -13,7 +13,7 @@
Name: hyperv-daemons Name: hyperv-daemons
Version: 0 Version: 0
Release: 0.41%{?snapver}%{?dist} Release: 1.41%{?snapver}%{?dist}
Summary: Hyper-V daemons suite Summary: Hyper-V daemons suite
License: GPLv2 License: GPLv2
@ -58,6 +58,8 @@ Patch9: hpvd-redhat-hv_set_if_config-Workaround-for-gateway-numbe.patch
Patch10: hpvd-tools-hv-Remove-an-extraneous-the.patch Patch10: hpvd-tools-hv-Remove-an-extraneous-the.patch
# For bz#2139457 - [Hyper-V][RHEL9.2] Update Hyper-V-Daemons # For bz#2139457 - [Hyper-V][RHEL9.2] Update Hyper-V-Daemons
Patch11: hpvd-tools-hv-kvp-remove-unnecessary-void-conversions.patch Patch11: hpvd-tools-hv-kvp-remove-unnecessary-void-conversions.patch
# For bz#2218931 - [Hyper-V] [RHEL-9] /usr/sbin/vmbus_testing python script prints: "SyntaxWarning: "is" with a literal."
Patch12: hpvd-vmbus_testing-fix-wrong-python-syntax-for-integer-va.patch
# Source-git patches # Source-git patches
@ -168,6 +170,7 @@ cp -pvL %{SOURCE301} lsvmbus
%patch9 -p1 %patch9 -p1
%patch10 -p1 %patch10 -p1
%patch11 -p1 %patch11 -p1
%patch12 -p1
%build %build
# HYPERV KVP DAEMON # HYPERV KVP DAEMON
@ -285,6 +288,11 @@ fi
%{_sbindir}/vmbus_testing %{_sbindir}/vmbus_testing
%changelog %changelog
* Mon Jul 10 2023 Miroslav Rezanina <mrezanin@redhat.com> - 0-1.41.20190303git
- hpvd-vmbus_testing-fix-wrong-python-syntax-for-integer-va.patch [bz#2218931]
- Resolves: bz#2218931
([Hyper-V] [RHEL-9] /usr/sbin/vmbus_testing python script prints: "SyntaxWarning: "is" with a literal.")
* Mon Nov 21 2022 Miroslav Rezanina <mrezanin@redhat.com> - 0-0.41.20190303git * Mon Nov 21 2022 Miroslav Rezanina <mrezanin@redhat.com> - 0-0.41.20190303git
- hpvd-redhat-hv_set_if_config-Workaround-for-gateway-numbe.patch [bz#2122115] - hpvd-redhat-hv_set_if_config-Workaround-for-gateway-numbe.patch [bz#2122115]
- hpvd-tools-hv-Remove-an-extraneous-the.patch [bz#2139457] - hpvd-tools-hv-Remove-an-extraneous-the.patch [bz#2139457]