working on getting tests back
This commit is contained in:
@@ -728,7 +728,6 @@ def multicall(context, topic, msg):
|
|||||||
wait_msg = MulticallWaiter(conn)
|
wait_msg = MulticallWaiter(conn)
|
||||||
conn.declare_direct_consumer(msg_id, wait_msg)
|
conn.declare_direct_consumer(msg_id, wait_msg)
|
||||||
conn.topic_send(topic, msg)
|
conn.topic_send(topic, msg)
|
||||||
|
|
||||||
return wait_msg
|
return wait_msg
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -120,7 +120,7 @@ def call_zone_method(context, method_name, errors_to_ignore=None,
|
|||||||
# Do this on behalf of the user ...
|
# Do this on behalf of the user ...
|
||||||
nova = novaclient.Client(zone.username, zone.password, None,
|
nova = novaclient.Client(zone.username, zone.password, None,
|
||||||
zone.api_url, region_name=zone.name,
|
zone.api_url, region_name=zone.name,
|
||||||
token = context.auth_token)
|
token=context.auth_token)
|
||||||
nova.authenticate()
|
nova.authenticate()
|
||||||
except novaclient_exceptions.BadRequest, e:
|
except novaclient_exceptions.BadRequest, e:
|
||||||
url = zone.api_url
|
url = zone.api_url
|
||||||
|
|||||||
@@ -102,7 +102,9 @@ def _call_novaclient(zone):
|
|||||||
|
|
||||||
def _poll_zone(zone):
|
def _poll_zone(zone):
|
||||||
"""Eventlet worker to poll a zone."""
|
"""Eventlet worker to poll a zone."""
|
||||||
logging.debug(_("Polling zone: %s @ %s") % (zone.name, zone.api_url))
|
name = zone.name
|
||||||
|
url = zone.api_url
|
||||||
|
logging.debug(_("Polling zone: %(name)s @ %(url)s") % locals())
|
||||||
try:
|
try:
|
||||||
zone.update_metadata(_call_novaclient(zone))
|
zone.update_metadata(_call_novaclient(zone))
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ class ZoneManagerTestCase(test.TestCase):
|
|||||||
self.mox.StubOutWithMock(db, 'zone_get_all')
|
self.mox.StubOutWithMock(db, 'zone_get_all')
|
||||||
db.zone_get_all(mox.IgnoreArg()).AndReturn([
|
db.zone_get_all(mox.IgnoreArg()).AndReturn([
|
||||||
FakeZone(id=1, api_url='http://foo.com', username='user1',
|
FakeZone(id=1, api_url='http://foo.com', username='user1',
|
||||||
password='pass1'),
|
password='pass1', name='child'),
|
||||||
])
|
])
|
||||||
|
|
||||||
self.assertEquals(len(zm.zone_states), 0)
|
self.assertEquals(len(zm.zone_states), 0)
|
||||||
@@ -107,13 +107,15 @@ class ZoneManagerTestCase(test.TestCase):
|
|||||||
zm = zone_manager.ZoneManager()
|
zm = zone_manager.ZoneManager()
|
||||||
zone_state = zone_manager.ZoneState()
|
zone_state = zone_manager.ZoneState()
|
||||||
zone_state.update_credentials(FakeZone(id=1, api_url='http://foo.com',
|
zone_state.update_credentials(FakeZone(id=1, api_url='http://foo.com',
|
||||||
username='user1', password='pass1'))
|
username='user1', password='pass1', name='child',
|
||||||
|
weight_offset=0.0, weight_scale=1.0))
|
||||||
zm.zone_states[1] = zone_state
|
zm.zone_states[1] = zone_state
|
||||||
|
|
||||||
self.mox.StubOutWithMock(db, 'zone_get_all')
|
self.mox.StubOutWithMock(db, 'zone_get_all')
|
||||||
db.zone_get_all(mox.IgnoreArg()).AndReturn([
|
db.zone_get_all(mox.IgnoreArg()).AndReturn([
|
||||||
FakeZone(id=1, api_url='http://foo.com', username='user2',
|
FakeZone(id=1, api_url='http://foo.com', username='user2',
|
||||||
password='pass2'),
|
password='pass2', name='child',
|
||||||
|
weight_offset=0.0, weight_scale=1.0),
|
||||||
])
|
])
|
||||||
|
|
||||||
self.assertEquals(len(zm.zone_states), 1)
|
self.assertEquals(len(zm.zone_states), 1)
|
||||||
@@ -129,7 +131,8 @@ class ZoneManagerTestCase(test.TestCase):
|
|||||||
zm = zone_manager.ZoneManager()
|
zm = zone_manager.ZoneManager()
|
||||||
zone_state = zone_manager.ZoneState()
|
zone_state = zone_manager.ZoneState()
|
||||||
zone_state.update_credentials(FakeZone(id=1, api_url='http://foo.com',
|
zone_state.update_credentials(FakeZone(id=1, api_url='http://foo.com',
|
||||||
username='user1', password='pass1'))
|
username='user1', password='pass1', name='child',
|
||||||
|
weight_offset=0.0, weight_scale=1.0))
|
||||||
zm.zone_states[1] = zone_state
|
zm.zone_states[1] = zone_state
|
||||||
|
|
||||||
self.mox.StubOutWithMock(db, 'zone_get_all')
|
self.mox.StubOutWithMock(db, 'zone_get_all')
|
||||||
@@ -147,14 +150,15 @@ class ZoneManagerTestCase(test.TestCase):
|
|||||||
zm = zone_manager.ZoneManager()
|
zm = zone_manager.ZoneManager()
|
||||||
zone_state = zone_manager.ZoneState()
|
zone_state = zone_manager.ZoneState()
|
||||||
zone_state.update_credentials(FakeZone(id=1, api_url='http://foo.com',
|
zone_state.update_credentials(FakeZone(id=1, api_url='http://foo.com',
|
||||||
username='user1', password='pass1'))
|
username='user1', password='pass1', name='child',
|
||||||
|
weight_offset=0.0, weight_scale=1.0))
|
||||||
zm.zone_states[1] = zone_state
|
zm.zone_states[1] = zone_state
|
||||||
|
|
||||||
self.mox.StubOutWithMock(db, 'zone_get_all')
|
self.mox.StubOutWithMock(db, 'zone_get_all')
|
||||||
|
|
||||||
db.zone_get_all(mox.IgnoreArg()).AndReturn([
|
db.zone_get_all(mox.IgnoreArg()).AndReturn([
|
||||||
FakeZone(id=2, api_url='http://foo.com', username='user2',
|
FakeZone(id=2, api_url='http://foo.com', username='user2',
|
||||||
password='pass2'),
|
password='pass2', name='child'),
|
||||||
])
|
])
|
||||||
self.assertEquals(len(zm.zone_states), 1)
|
self.assertEquals(len(zm.zone_states), 1)
|
||||||
|
|
||||||
@@ -173,7 +177,8 @@ class ZoneManagerTestCase(test.TestCase):
|
|||||||
zone_state = zone_manager.ZoneState()
|
zone_state = zone_manager.ZoneState()
|
||||||
zone_state.update_credentials(FakeZone(id=2,
|
zone_state.update_credentials(FakeZone(id=2,
|
||||||
api_url='http://foo.com', username='user2',
|
api_url='http://foo.com', username='user2',
|
||||||
password='pass2'))
|
password='pass2', name='child',
|
||||||
|
weight_offset=0.0, weight_scale=1.0))
|
||||||
zone_state.attempt = 1
|
zone_state.attempt = 1
|
||||||
|
|
||||||
self.mox.ReplayAll()
|
self.mox.ReplayAll()
|
||||||
@@ -188,7 +193,8 @@ class ZoneManagerTestCase(test.TestCase):
|
|||||||
zone_state = zone_manager.ZoneState()
|
zone_state = zone_manager.ZoneState()
|
||||||
zone_state.update_credentials(FakeZone(id=2,
|
zone_state.update_credentials(FakeZone(id=2,
|
||||||
api_url='http://foo.com', username='user2',
|
api_url='http://foo.com', username='user2',
|
||||||
password='pass2'))
|
password='pass2', name='child',
|
||||||
|
weight_offset=0.0, weight_scale=1.0))
|
||||||
zone_state.attempt = FLAGS.zone_failures_to_offline - 1
|
zone_state.attempt = FLAGS.zone_failures_to_offline - 1
|
||||||
|
|
||||||
self.mox.ReplayAll()
|
self.mox.ReplayAll()
|
||||||
|
|||||||
Reference in New Issue
Block a user