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

Commit fd5c623

Browse files
lingy1028mayurah
authored andcommitted
fix: forced convert the type of port from string to int
1 parent 089f90d commit fd5c623

File tree

1 file changed

+2
-2
lines changed
  • splunk_connect_for_snmp_mib_server

1 file changed

+2
-2
lines changed

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'], os.environ['MONGO_SERVICE_PORT'])
12+
self._client = MongoClient(os.environ['MONGO_SERVICE_SERVICE_HOST'], int(os.environ['MONGO_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'], os.environ['MONGO_SERVICE_PORT'])
65+
self._client = MongoClient(os.environ['MONGO_SERVICE_SERVICE_HOST'], int(os.environ['MONGO_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)