diff mbox

[ovs-dev,1/6] xenserver: Sort vsctl port options.

Message ID 1464052831-17278-2-git-send-email-joe@ovn.org
State Accepted
Headers show

Commit Message

Joe Stringer May 24, 2016, 1:20 a.m. UTC
In python3, dictionaries are less likely to be sorted consistently from
one run to the next, so sort port options when outputting to provide
reliable test results.

Signed-off-by: Joe Stringer <joe@ovn.org>
---
 tests/interface-reconfigure.at                                 | 4 ++--
 xenserver/opt_xensource_libexec_InterfaceReconfigureVswitch.py | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

Comments

Ben Pfaff June 3, 2016, 3:58 p.m. UTC | #1
On Mon, May 23, 2016 at 06:20:26PM -0700, Joe Stringer wrote:
> In python3, dictionaries are less likely to be sorted consistently from
> one run to the next, so sort port options when outputting to provide
> reliable test results.
> 
> Signed-off-by: Joe Stringer <joe@ovn.org>

Thanks.

Acked-by: Ben Pfaff <blp@ovn.org>
diff mbox

Patch

diff --git a/tests/interface-reconfigure.at b/tests/interface-reconfigure.at
index 668f63d2b9b4..bb3756be2f82 100644
--- a/tests/interface-reconfigure.at
+++ b/tests/interface-reconfigure.at
@@ -890,7 +890,7 @@  Applying changes to /etc/sysconfig/network-scripts/ifcfg-xapi1 configuration
     --may-exist add-br xapi1
     --with-iface --if-exists del-port bond0
     --fake-iface add-bond xapi1 bond0 eth0 eth1
-    set Port bond0 MAC="00:22:19:22:4b:af" other-config:bond-miimon-interval=100 bond_downdelay=200 bond_updelay=31000 other-config:bond-detect-mode=carrier lacp=off bond_mode=balance-slb
+    set Port bond0 MAC="00:22:19:22:4b:af" bond_downdelay=200 other-config:bond-miimon-interval=100 bond_updelay=31000 other-config:bond-detect-mode=carrier lacp=off bond_mode=balance-slb
     set Bridge xapi1 other-config:hwaddr="00:22:19:22:4b:af"
     set Bridge xapi1 fail_mode=secure
     remove Bridge xapi1 other_config disable-in-band
@@ -980,7 +980,7 @@  Applying changes to /etc/sysconfig/network-scripts/ifcfg-xapi2 configuration
     --may-exist add-br xapi1
     --with-iface --if-exists del-port bond0
     --fake-iface add-bond xapi1 bond0 eth0 eth1
-    set Port bond0 MAC="00:22:19:22:4b:af" other-config:bond-miimon-interval=100 bond_downdelay=200 bond_updelay=31000 other-config:bond-detect-mode=carrier lacp=off bond_mode=balance-slb
+    set Port bond0 MAC="00:22:19:22:4b:af" bond_downdelay=200 other-config:bond-miimon-interval=100 bond_updelay=31000 other-config:bond-detect-mode=carrier lacp=off bond_mode=balance-slb
     set Bridge xapi1 other-config:hwaddr="00:22:19:22:4b:af"
     set Bridge xapi1 fail_mode=secure
     remove Bridge xapi1 other_config disable-in-band
diff --git a/xenserver/opt_xensource_libexec_InterfaceReconfigureVswitch.py b/xenserver/opt_xensource_libexec_InterfaceReconfigureVswitch.py
index 1379fb462119..30fc176694a9 100644
--- a/xenserver/opt_xensource_libexec_InterfaceReconfigureVswitch.py
+++ b/xenserver/opt_xensource_libexec_InterfaceReconfigureVswitch.py
@@ -206,7 +206,7 @@  def datapath_configure_bond(pif,slaves):
     argv += ['--', 'set', 'Port', interface]
     if pifrec['MAC'] != "":
         argv += ['MAC=%s' % vsctl_escape(pifrec['MAC'])]
-    for (name,val) in bond_options.items():
+    for (name,val) in sorted(bond_options.items()):
         if name in ['updelay', 'downdelay']:
             # updelay and downdelay have dedicated schema columns.
             # The value must be a nonnegative integer.