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 json
import re
import jsonschema import jsonschema
...@@ -24,7 +23,6 @@ CONFIG_SCHEMA = { ...@@ -24,7 +23,6 @@ CONFIG_SCHEMA = {
"type": "object", "type": "object",
"properties": { "properties": {
"ops-db": {"$ref": "#/definitions/database_credentials"}, "ops-db": {"$ref": "#/definitions/database_credentials"},
"oid_list.conf": {"type": "string"},
"ssh": { "ssh": {
"type": "object", "type": "object",
"properties": { "properties": {
...@@ -64,7 +62,6 @@ CONFIG_SCHEMA = { ...@@ -64,7 +62,6 @@ CONFIG_SCHEMA = {
{ {
"required": [ "required": [
"ops-db", "ops-db",
"oid_list.conf",
"ssh", "ssh",
"redis", "redis",
"junosspace"] "junosspace"]
...@@ -72,7 +69,6 @@ CONFIG_SCHEMA = { ...@@ -72,7 +69,6 @@ CONFIG_SCHEMA = {
{ {
"required": [ "required": [
"ops-db", "ops-db",
"oid_list.conf",
"ssh", "ssh",
"sentinel", "sentinel",
"junosspace"] "junosspace"]
...@@ -82,19 +78,6 @@ CONFIG_SCHEMA = { ...@@ -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): def load(f):
""" """
loads, validates and returns configuration parameters loads, validates and returns configuration parameters
...@@ -104,6 +87,4 @@ def load(f): ...@@ -104,6 +87,4 @@ def load(f):
""" """
config = json.loads(f.read()) config = json.loads(f.read())
jsonschema.validate(config, CONFIG_SCHEMA) jsonschema.validate(config, CONFIG_SCHEMA)
# with open(config["oid_list.conf"]) as f:
# config["oids"] = _load_oids(f)
return config return config
...@@ -31,10 +31,6 @@ def data_config_filename(): ...@@ -31,10 +31,6 @@ def data_config_filename():
"username": "xxxxxx", "username": "xxxxxx",
"password": "xxxxxxxx" "password": "xxxxxxxx"
}, },
# TODO: remove oid_list.conf
"oid_list.conf": os.path.join(
'',
"oid_list.conf"),
"ssh": { "ssh": {
"username": "uSeR-NaMe", "username": "uSeR-NaMe",
"private-key": "private-key-filename", "private-key": "private-key-filename",
...@@ -51,13 +47,6 @@ def data_config_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.write(json.dumps(config).encode('utf-8'))
f.flush() f.flush()
yield f.name 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