diff --git a/nova/scheduler/zone_manager.py b/nova/scheduler/zone_manager.py index 758c5e3d..edf9000c 100644 --- a/nova/scheduler/zone_manager.py +++ b/nova/scheduler/zone_manager.py @@ -17,7 +17,7 @@ ZoneManager oversees all communications with child Zones. """ -import novatools +import novaclient import thread import traceback @@ -85,9 +85,9 @@ class ZoneState(object): "attempts. Marking inactive.") % locals()) -def _call_novatools(zone): - """Call novatools. Broken out for testing purposes.""" - client = novatools.OpenStack(zone.username, zone.password, zone.api_url) +def _call_novaclient(zone): + """Call novaclient. Broken out for testing purposes.""" + client = novaclient.OpenStack(zone.username, zone.password, zone.api_url) return client.zones.info()._info @@ -95,7 +95,7 @@ def _poll_zone(zone): """Eventlet worker to poll a zone.""" logging.debug(_("Polling zone: %s") % zone.api_url) try: - zone.update_metadata(_call_novatools(zone)) + zone.update_metadata(_call_novaclient(zone)) except Exception, e: zone.log_error(traceback.format_exc()) diff --git a/nova/tests/test_zones.py b/nova/tests/test_zones.py index c273230a..5a52a050 100644 --- a/nova/tests/test_zones.py +++ b/nova/tests/test_zones.py @@ -18,7 +18,7 @@ Tests For ZoneManager import datetime import mox -import novatools +import novaclient from nova import context from nova import db @@ -40,8 +40,8 @@ class FakeZone: setattr(self, k, v) -def exploding_novatools(zone): - """Used when we want to simulate a novatools call failing.""" +def exploding_novaclient(zone): + """Used when we want to simulate a novaclient call failing.""" raise Exception("kaboom") @@ -139,8 +139,8 @@ class ZoneManagerTestCase(test.TestCase): self.assertEquals(zm.zone_states[2].username, 'user2') def test_poll_zone(self): - self.mox.StubOutWithMock(zone_manager, '_call_novatools') - zone_manager._call_novatools(mox.IgnoreArg()).AndReturn( + self.mox.StubOutWithMock(zone_manager, '_call_novaclient') + zone_manager._call_novaclient(mox.IgnoreArg()).AndReturn( dict(name='zohan', capabilities='hairdresser')) zone_state = zone_manager.ZoneState() @@ -156,7 +156,7 @@ class ZoneManagerTestCase(test.TestCase): self.assertEquals(zone_state.name, 'zohan') def test_poll_zone_fails(self): - self.stubs.Set(zone_manager, "_call_novatools", exploding_novatools) + self.stubs.Set(zone_manager, "_call_novaclient", exploding_novaclient) zone_state = zone_manager.ZoneState() zone_state.update_credentials(FakeZone(id=2,