diff options
| author | Aaron Lee <aaron.lee@rackspace.com> | 2011-12-13 14:43:51 -0600 |
|---|---|---|
| committer | Aaron Lee <aaron.lee@rackspace.com> | 2011-12-13 14:44:02 -0600 |
| commit | 736583fd9f5d166f0c7b0ed9d8556d332cf2bd5b (patch) | |
| tree | 3319d6fc73e8686d928d111416175244247b4150 /nova/virt | |
| parent | f597dc5548d66530e68ff5809ac2c56b7edbc6d8 (diff) | |
Make sure the rxtx_cap is used to set qos info
Change-Id: Id06d12a24756ce865e3b7e1b79185dddbdb71582
Diffstat (limited to 'nova/virt')
| -rw-r--r-- | nova/virt/xenapi/vif.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/nova/virt/xenapi/vif.py b/nova/virt/xenapi/vif.py index 2f25efeb2..e3d7b9a7d 100644 --- a/nova/virt/xenapi/vif.py +++ b/nova/virt/xenapi/vif.py @@ -41,7 +41,6 @@ class XenAPIBridgeDriver(VIFDriver): else: network_ref = NetworkHelper.find_network_with_bridge( xenapi_session, network['bridge']) - rxtx_cap = network_mapping.pop('rxtx_cap') vif_rec = {} vif_rec['device'] = str(device) vif_rec['network'] = network_ref @@ -49,9 +48,13 @@ class XenAPIBridgeDriver(VIFDriver): vif_rec['MAC'] = network_mapping['mac'] vif_rec['MTU'] = '1500' vif_rec['other_config'] = {} - vif_rec['qos_algorithm_type'] = "ratelimit" if rxtx_cap else '' - vif_rec['qos_algorithm_params'] = \ - {"kbps": str(rxtx_cap * 1024)} if rxtx_cap else {} + if "rxtx_cap" in network_mapping: + vif_rec['qos_algorithm_type'] = "ratelimit" + vif_rec['qos_algorithm_params'] = \ + {"kbps": str(network_mapping['rxtx_cap'] * 1024)} + else: + vif_rec['qos_algorithm_type'] = "" + vif_rec['qos_algorithm_params'] = {} return vif_rec def ensure_vlan_bridge(self, xenapi_session, network): |
