From 2d57bfce57f2c71d1f396ad091e7c45ed2862f41 Mon Sep 17 00:00:00 2001 From: Dominic Curran Date: Wed, 15 Feb 2012 17:17:25 +0000 Subject: [PATCH] xenserver: Fix iteration of dictionary. Fix bug in commit 3249bb907a1dab9b0, which incorrectly assumed that get_all_records_where() returned a list. It in fact returns a dictionary and the list iteratory needs to change to account for this. Thanks to Nicira for pointing this out. NIC-454. Reported-by: David Tsai Acked-by: Rob Hoes Signed-off-by: Dominic Curran Signed-off-by: Ben Pfaff --- AUTHORS | 2 +- xenserver/etc_xapi.d_plugins_openvswitch-cfg-update | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/AUTHORS b/AUTHORS index cd7c9d3b4..58f7eccd3 100644 --- a/AUTHORS +++ b/AUTHORS @@ -16,6 +16,7 @@ Dan Wendlandt dan@nicira.com Daniel Roman droman@nicira.com David Erickson derickso@stanford.edu Devendra Naga devendra.aaru@gmail.com +Dominic Curran dominic.curran@citrix.com Edward Tomasz Napierała trasz@freebsd.org Ethan Jackson ethan@nicira.com Gaetano Catalli gaetano.catalli@gmail.com @@ -76,7 +77,6 @@ Bryan Osoro bosoro@nicira.com Cedric Hobbs cedric@nicira.com Dave Walker DaveWalker@ubuntu.com Derek Cormier derek.cormier@lab.ntt.co.jp -Dominic Curran dominic.curran@citrix.com Duffie Cooley dcooley@nicira.com DK Moon dkmoon@nicira.com Edwin Chiu echiu@nicira.com diff --git a/xenserver/etc_xapi.d_plugins_openvswitch-cfg-update b/xenserver/etc_xapi.d_plugins_openvswitch-cfg-update index a9a10e83f..ef4d11a8e 100755 --- a/xenserver/etc_xapi.d_plugins_openvswitch-cfg-update +++ b/xenserver/etc_xapi.d_plugins_openvswitch-cfg-update @@ -100,7 +100,7 @@ def update(session, args): pool_mgmt_macs = {} if new_controller: recs = session.xenapi.PIF.get_all_records_where('field "management"="true"') - for rec in recs: + for rec in recs.itervalues(): pool_mgmt_macs[rec.get('MAC')] = rec.get('device') dib_changed = False -- 2.43.0