diff options
author | Jenkins <jenkins@review.openstack.org> | 2012-11-07 17:44:01 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2012-11-07 17:44:01 +0000 |
commit | ae05388ac4977ccbe927a0714cb093289f6d63c8 (patch) | |
tree | 1565438b5b6c36f3ca34d994bb10675ab44e5473 | |
parent | 562b3abc843942a096e5750161c1aae2402d595b (diff) | |
parent | 65644195fed64a2b4e70c797b4faeddedd12a3d6 (diff) | |
download | nova-ae05388ac4977ccbe927a0714cb093289f6d63c8.tar.gz nova-ae05388ac4977ccbe927a0714cb093289f6d63c8.tar.xz nova-ae05388ac4977ccbe927a0714cb093289f6d63c8.zip |
Merge "Fix bandwidth polling exception."
-rw-r--r-- | nova/compute/manager.py | 5 | ||||
-rwxr-xr-x | plugins/xenserver/xenapi/etc/xapi.d/plugins/bandwidth | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/nova/compute/manager.py b/nova/compute/manager.py index de848abdd..10f9ee7dc 100644 --- a/nova/compute/manager.py +++ b/nova/compute/manager.py @@ -2821,8 +2821,9 @@ class ComputeManager(manager.SchedulerDependentManager): bw_ctr['uuid'], prev_time, bw_ctr['mac_address']) - last_ctr_in = usage['last_ctr_in'] - last_ctr_out = usage['last_ctr_out'] + if usage: + last_ctr_in = usage['last_ctr_in'] + last_ctr_out = usage['last_ctr_out'] if last_ctr_in is not None: if bw_ctr['bw_in'] < last_ctr_in: diff --git a/plugins/xenserver/xenapi/etc/xapi.d/plugins/bandwidth b/plugins/xenserver/xenapi/etc/xapi.d/plugins/bandwidth index 171011a06..4c4538fa4 100755 --- a/plugins/xenserver/xenapi/etc/xapi.d/plugins/bandwidth +++ b/plugins/xenserver/xenapi/etc/xapi.d/plugins/bandwidth @@ -38,7 +38,7 @@ def _read_proc_net(): dev = devmap.get(dom, {}) # Note, we deliberately swap in and out, as instance traffic # shows up inverted due to going though the bridge. (mdragon) - dev[vifnum] = dict(bw_in=int(slist[0]), bw_out=int(slist[8])) + dev[vifnum] = dict(bw_in=int(slist[8]), bw_out=int(slist[0])) devmap[dom] = dev return devmap |