Example #1
0
    def __init__(self, cli_opts):
        ''' initialize the Config Store client '''

        self.client = config_store_client.ConfigStoreClient(
            cli_opts.zmq_ctx,
            cli_opts.config_store_url,
            cli_opts.timeout,
            cli_opts.proto_factory)
Example #2
0
        def _cs_client():
            cs_client_inst = config_store_client.ConfigStoreClient(
                zmq.Context(), "ipc:///tmp/config_store_cmd")

            self.assertEqual(cs_client_inst.load('key1'), store_db['key1'])
            with self.assertRaises(Exception):
                cs_client_inst.load('key3')

            self.assertTrue(cs_client_inst.erase('key1'))
            with self.assertRaises(Exception):
                cs_client_inst.load('key1')

            value = serialize_thrift_object(
                lm_types.DumpLinksReply(thisNodeName='node5'))
            self.assertTrue(cs_client_inst.store('key5', value))
            self.assertEqual(cs_client_inst.load('key5'), value)
        def _cs_client():
            cs_client_inst = config_store_client.ConfigStoreClient(
                ctx, "inproc://openr_config_store_cmd")

            self.assertEqual(cs_client_inst.load("key1"), store_db["key1"])
            with self.assertRaises(Exception):
                cs_client_inst.load("key3")

            self.assertTrue(cs_client_inst.erase("key1"))
            with self.assertRaises(Exception):
                cs_client_inst.load("key1")

            value = serialize_thrift_object(
                lm_types.DumpLinksReply(thisNodeName="node5"))
            self.assertTrue(cs_client_inst.store("key5", value))
            self.assertEqual(cs_client_inst.load("key5"), value)
Example #4
0
    def __init__(self, cli_opts):
        """ initialize the Config Store client """

        self.client = config_store_client.ConfigStoreClient(cli_opts)