[libvirt] [PATCH] hyperv: Sync generator output between python versions

Cole Robinson posted 1 patch 6 years, 1 month ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/8264138d48911e00add0afe6ff753e4043a8a393.1521488284.git.crobinso@redhat.com
Test syntax-check passed
src/hyperv/hyperv_wmi_generator.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[libvirt] [PATCH] hyperv: Sync generator output between python versions
Posted by Cole Robinson 6 years, 1 month ago
Yet another dependency on dict() hash ordering

Signed-off-by: Cole Robinson <crobinso@redhat.com>
---
 src/hyperv/hyperv_wmi_generator.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/hyperv/hyperv_wmi_generator.py b/src/hyperv/hyperv_wmi_generator.py
index d54810211..6582fe1f1 100755
--- a/src/hyperv/hyperv_wmi_generator.py
+++ b/src/hyperv/hyperv_wmi_generator.py
@@ -271,7 +271,7 @@ class WmiClass:
 
         # isolate those that are common for all and keep track of their postions
         pos = 0
-        for key in property_info:
+        for key in sorted(property_info):
             info = property_info[key]
             # exists in all class versions
             if info[1] == num_classes:
-- 
2.14.3

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] hyperv: Sync generator output between python versions
Posted by Daniel P. Berrangé 6 years, 1 month ago
On Mon, Mar 19, 2018 at 03:38:04PM -0400, Cole Robinson wrote:
> Yet another dependency on dict() hash ordering
> 
> Signed-off-by: Cole Robinson <crobinso@redhat.com>
> ---
>  src/hyperv/hyperv_wmi_generator.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] hyperv: Sync generator output between python versions
Posted by Andrea Bolognani 6 years, 1 month ago
On Mon, 2018-03-19 at 15:38 -0400, Cole Robinson wrote:
> Yet another dependency on dict() hash ordering
> 
> Signed-off-by: Cole Robinson <crobinso@redhat.com>
> ---
>  src/hyperv/hyperv_wmi_generator.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/hyperv/hyperv_wmi_generator.py b/src/hyperv/hyperv_wmi_generator.py
> index d54810211..6582fe1f1 100755
> --- a/src/hyperv/hyperv_wmi_generator.py
> +++ b/src/hyperv/hyperv_wmi_generator.py
> @@ -271,7 +271,7 @@ class WmiClass:
>  
>          # isolate those that are common for all and keep track of their postions
>          pos = 0
> -        for key in property_info:
> +        for key in sorted(property_info):
>              info = property_info[key]
>              # exists in all class versions
>              if info[1] == num_classes:

Reviewed-by: Andrea Bolognani <abologna@redhat.com>

The order in which struct members appear is now different from what
it was before but it's consistent between Python 2 and 3. Hopefully
none of this matters in practice, but if anything broke because of
it at least we're sure to get bug reports quickly :)

-- 
Andrea Bolognani / Red Hat / Virtualization

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list