]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Move declaration of int_br_device_count earlier
authorDerek Higgins <derekh@redhat.com>
Wed, 4 Sep 2013 22:05:08 +0000 (23:05 +0100)
committerDerek Higgins <derekh@redhat.com>
Thu, 5 Sep 2013 14:00:37 +0000 (15:00 +0100)
commitbecadd39df087544ac1ce97926cc3014fd286e08
treea553a4d9792ba5d9c3d99d07ba23243dce52b339
parent062ee16e09fb2ba7d89a80bdeb8de1eee978ac2e
Move declaration of int_br_device_count earlier

_report_state is being called by setup_rpc so int_br_device_count needs
to be initialized earlier. To avoid
AttributeError: object has no attribute 'int_br_device_count'

This wasn't caught by unit tests for 3 separate reason
o The reference to self.int_br_device_count is wrapped in
  except Exception: log / pass
- This reference has been moved outside of the try/except

o Unit tests set report_interval to 0 so the heartbeat wasn't called
  during unit tests.
- now removed

o The function passed into FixedIntervalLoopingCall isn't started
  anyways so wasn't calling self._report_state
- replaced FixedIntervalLoopingCall with a mock that calls the
  function once.

Fixes bug #1221054

Change-Id: I572af4ee017c1f7f016c8f9981ca54d1301442d1
neutron/plugins/openvswitch/agent/ovs_neutron_agent.py
neutron/tests/unit/openvswitch/test_ovs_neutron_agent.py