X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=xenserver%2Fetc_xapi.d_plugins_openvswitch-cfg-update;h=3945974c0726fd5d258edc052484d27061c65358;hb=53cf9963ccc60b443d738b31fbb446bc79170693;hp=cc97c2d36103a730e827cfa98279a58a9106a03f;hpb=e084518ad4e7ce349d23ddda7c74ea8a57ca0f56;p=sliver-openvswitch.git diff --git a/xenserver/etc_xapi.d_plugins_openvswitch-cfg-update b/xenserver/etc_xapi.d_plugins_openvswitch-cfg-update index cc97c2d36..3945974c0 100755 --- a/xenserver/etc_xapi.d_plugins_openvswitch-cfg-update +++ b/xenserver/etc_xapi.d_plugins_openvswitch-cfg-update @@ -4,7 +4,7 @@ # ovs-vswitchd configuration that are managed in the xapi database when # integrated with Citrix management tools. -# Copyright (C) 2009, 2010, 2011 Nicira Networks, Inc. +# Copyright (C) 2009, 2010, 2011 Nicira, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -86,8 +86,7 @@ def update(session, args): bton = {} - for n in session.xenapi.network.get_all(): - rec = session.xenapi.network.get_record(n) + for rec in session.xenapi.network.get_all_records().values(): try: bton[rec['bridge']] = rec except KeyError: @@ -100,10 +99,9 @@ def update(session, args): host_mgmt_device = None pool_mgmt_macs = {} if new_controller: - for n in session.xenapi.PIF.get_all(): - rec = session.xenapi.PIF.get_record(n) - if rec.get('management', False): - pool_mgmt_macs[rec.get('MAC')] = rec.get('device') + recs = session.xenapi.PIF.get_all_records_where('field "management"="true"') + for rec in recs.itervalues(): + pool_mgmt_macs[rec.get('MAC')] = rec.get('device') dib_changed = False fail_mode_changed = False