Skip to content
Snippets Groups Projects
Commit 0e32a55b authored by Erik Reid's avatar Erik Reid
Browse files

removed references to oid_list.conf

parent e8d0fa6d
No related branches found
No related tags found
No related merge requests found
import json
import re
import jsonschema
......@@ -24,7 +23,6 @@ CONFIG_SCHEMA = {
"type": "object",
"properties": {
"ops-db": {"$ref": "#/definitions/database_credentials"},
"oid_list.conf": {"type": "string"},
"ssh": {
"type": "object",
"properties": {
......@@ -64,7 +62,6 @@ CONFIG_SCHEMA = {
{
"required": [
"ops-db",
"oid_list.conf",
"ssh",
"redis",
"junosspace"]
......@@ -72,7 +69,6 @@ CONFIG_SCHEMA = {
{
"required": [
"ops-db",
"oid_list.conf",
"ssh",
"sentinel",
"junosspace"]
......@@ -82,19 +78,6 @@ CONFIG_SCHEMA = {
}
def _load_oids(config_file):
"""
:param config_file: file-like object
:return:
"""
result = {}
for line in config_file:
m = re.match(r'^([^=]+)=(.*)\s*$', line)
if m:
result[m.group(1)] = m.group(2)
return result
def load(f):
"""
loads, validates and returns configuration parameters
......@@ -104,6 +87,4 @@ def load(f):
"""
config = json.loads(f.read())
jsonschema.validate(config, CONFIG_SCHEMA)
# with open(config["oid_list.conf"]) as f:
# config["oids"] = _load_oids(f)
return config
......@@ -31,10 +31,6 @@ def data_config_filename():
"username": "xxxxxx",
"password": "xxxxxxxx"
},
# TODO: remove oid_list.conf
"oid_list.conf": os.path.join(
'',
"oid_list.conf"),
"ssh": {
"username": "uSeR-NaMe",
"private-key": "private-key-filename",
......@@ -51,13 +47,6 @@ def data_config_filename():
}
}
# shutil.copyfile(
# os.path.join(TEST_DATA_DIRNAME, 'oid_list.conf'),
# config['oid_list.conf']
# )
#
# filename = os.path.join(tmp_dir_name, "config.json")
# with open(filename, "w") as f:
f.write(json.dumps(config).encode('utf-8'))
f.flush()
yield f.name
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment