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

Commit dd72a91

Browse files
committed
fox: wrong merge
1 parent 05d0e2c commit dd72a91

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

splunk_connect_for_snmp_mib_server/mongo.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ def __init__(self, mongo_config):
1111
os.environ["MONGO_SERVICE_SERVICE_HOST"],
1212
int(os.environ["MONGO_SERVICE_SERVICE_PORT"]),
1313
)
14+
if os.environ.get("MONGO_USER"):
15+
self._client.admin.authenticate(
16+
os.environ["MONGO_USER"],
17+
os.environ["MONGO_PASS"],
18+
mechanism="SCRAM-SHA-1",
19+
)
1420
self._mibs = self._client[mongo_config["database"]][mongo_config["collection"]]
1521

1622
def upload_files(self, mib_files_dir):
@@ -46,6 +52,12 @@ def __init__(self, mongo_config):
4652
os.environ["MONGO_SERVICE_SERVICE_HOST"],
4753
int(os.environ["MONGO_SERVICE_SERVICE_PORT"]),
4854
)
55+
if os.environ.get("MONGO_USER"):
56+
self._client.admin.authenticate(
57+
os.environ["MONGO_USER"],
58+
os.environ["MONGO_PASS"],
59+
mechanism="SCRAM-SHA-1",
60+
)
4961
self._oids = self._client[mongo_config["database"]][mongo_config["collection"]]
5062

5163
def contains_oid(self, oid):

splunk_connect_for_snmp_mib_server/translator.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,6 @@ def check_mongo(self, oid):
185185

186186
return no_mapping_mib
187187

188-
189188
# Translate SNMP PDU varBinds into MIB objects using MIB
190189
def mib_translator(self, var_bind):
191190
# Run var-binds through MIB resolver

0 commit comments

Comments
 (0)