def __init__(self, rpc=None): self.rpc = rpc or arista_ml2.AristaRPCWrapper() self.db_nets = db.AristaProvisionedNets() self.db_vms = db.AristaProvisionedVms() self.db_tenants = db.AristaProvisionedTenants() self.ndb = db_lib.NeutronNets() confg = cfg.CONF.ml2_arista self.segmentation_type = db_lib.VLAN_SEGMENTATION self.timer = None self.eos = arista_ml2.SyncService(self.rpc, self.ndb) self.sync_timeout = confg['sync_interval'] self.eos_sync_lock = threading.Lock()
def test_exception_is_raised_on_json_server_error(self): drv = arista_ml2.AristaRPCWrapper() drv._server = mock.MagicMock() drv._server.runCmds.side_effect = Exception('server error') self.assertRaises(arista_exc.AristaRpcError, drv.get_tenants)
def setUp(self): super(PositiveRPCWrapperValidConfigTestCase, self).setUp() setup_valid_config() self.drv = arista_ml2.AristaRPCWrapper() self.region = 'RegionOne' self.drv._server = mock.MagicMock()