示例#1
0
 def initialize(self):
     self.resource_groups = nwa_com_utils.load_json_from_file(
         'resource_group',
         cfg.CONF.NWA.resource_group_file,
         cfg.CONF.NWA.resource_group,
         default_value=[])
     self.necnwa_router = cfg.CONF.NWA.use_necnwa_router
     self.multi_dc = cfg.CONF.NWA.use_neutron_vlan_id
 def __init__(self):
     super(NECNWAL3Plugin, self).__init__()
     l3_db.subscribe()
     self.start_rpc_listeners()
     self.nwa_proxies = {}
     self.resource_groups = nwa_com_utils.load_json_from_file(
         'resource_group', cfg.CONF.NWA.resource_group_file,
         cfg.CONF.NWA.resource_group, default_value=[])
示例#3
0
 def _test_load_json_from_file_from_file(self, json_str=None):
     json_data = {'foo': 'bar'}
     json_file = self.get_temp_file_path('test.json')
     with open(json_file, 'w') as f:
         f.write(jsonutils.dumps(json_data))
     ret = nwa_com_utils.load_json_from_file('test', json_file, json_str,
                                             [])
     self.assertEqual(json_data, ret)
 def _test_load_json_from_file_from_file(self, json_str=None):
     json_data = {'foo': 'bar'}
     json_file = self.get_temp_file_path('test.json')
     with open(json_file, 'w') as f:
         f.write(jsonutils.dumps(json_data))
     ret = nwa_com_utils.load_json_from_file('test', json_file,
                                             json_str, [])
     self.assertEqual(json_data, ret)
示例#5
0
 def initialize(self):
     self.resource_groups = nwa_com_utils.load_json_from_file(
         'resource_group', cfg.CONF.NWA.resource_group_file,
         cfg.CONF.NWA.resource_group, default_value=[])
示例#6
0
 def test_load_json_from_file_default_value(self):
     self.assertEqual(
         'test_data',
         nwa_com_utils.load_json_from_file('test', None, None, 'test_data'))
示例#7
0
 def test_load_json_from_file_from_str(self):
     json_data = {'foo': 'bar'}
     json_str = jsonutils.dumps(json_data)
     ret = nwa_com_utils.load_json_from_file('test', None, json_str, [])
     self.assertEqual(json_data, ret)
 def initialize(self):
     self.resource_groups = nwa_com_utils.load_json_from_file(
         'resource_group', cfg.CONF.NWA.resource_group_file,
         cfg.CONF.NWA.resource_group, default_value=[])
     self.necnwa_router = cfg.CONF.NWA.use_necnwa_router
     self.multi_dc = cfg.CONF.NWA.use_neutron_vlan_id
 def test_load_json_from_file_default_value(self):
     self.assertEqual(
         'test_data',
         nwa_com_utils.load_json_from_file('test', None, None, 'test_data'))
示例#10
0
 def test_load_json_from_file_from_str(self):
     json_data = {'foo': 'bar'}
     json_str = jsonutils.dumps(json_data)
     ret = nwa_com_utils.load_json_from_file('test', None, json_str, [])
     self.assertEqual(json_data, ret)
示例#11
0
 def initialize(self):
     self.resource_groups = nwa_com_utils.load_json_from_file(
         'resource_group',
         cfg.CONF.NWA.resource_group_file,
         cfg.CONF.NWA.resource_group,
         default_value=[])