Skip to content
This repository was archived by the owner on Dec 17, 2021. It is now read-only.

Commit 18e1e5b

Browse files
lstoppaweliasz
andauthored
Externalising config (#13)
* feat: externalizing config for Mongo * feat: externalizing config * feat: externalizing config * feat: externalizing config * feat: externalizing config Co-authored-by: weliasz <[email protected]>
1 parent fd5c623 commit 18e1e5b

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

splunk_connect_for_snmp_mib_server/mib_server.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ def __init__(self, args, server_config):
1717

1818
def build_flask_app(self):
1919
app = Flask(__name__)
20-
21-
ppath = "http://" + os.environ['MONGO_SERVICE_SERVICE_HOST'] + ":" + os.environ['MONGO_SERVICE_PORT'] + "/files/asn1/@mib@"
22-
20+
ppath = os.environ['MIBS_SERVER_URL']
2321
files_index = AutoIndex(app, ppath, add_url_rules=False)
2422

2523
@app.route('/')

splunk_connect_for_snmp_mib_server/mongo.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ def __init__(self, mongo_config):
99
"""
1010
Create a collection in mongodb to store mib files
1111
"""
12-
self._client = MongoClient(os.environ['MONGO_SERVICE_SERVICE_HOST'], int(os.environ['MONGO_SERVICE_PORT']))
12+
self._client = MongoClient(os.environ['MONGO_SERVICE_SERVICE_HOST'], int(os.environ['MONGO_SERVICE_SERVICE_PORT']))
1313
self._mibs = self._client[mongo_config['database']][mongo_config['collection']]
1414

1515

@@ -62,7 +62,7 @@ def clear(self):
6262

6363
class OidsRepository:
6464
def __init__(self, mongo_config):
65-
self._client = MongoClient(os.environ['MONGO_SERVICE_SERVICE_HOST'], int(os.environ['MONGO_SERVICE_PORT']))
65+
self._client = MongoClient(os.environ['MONGO_SERVICE_SERVICE_HOST'], int(os.environ['MONGO_SERVICE_SERVICE_PORT']))
6666
self._oids = self._client[mongo_config['database']][mongo_config['collection']]
6767

6868
def contains_oid(self, oid):

0 commit comments

Comments
 (0)