Skip to content

Commit

Permalink
Merge pull request #9 from JunAishima/harmonize-kwargs-and-client-check
Browse files Browse the repository at this point in the history
Harmonize kwargs and client check
  • Loading branch information
gwbischof authored Mar 7, 2024
2 parents cd29cbe + b5a84e9 commit 9fbc029
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions conftrak/ignition.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ def parse_configuration(config=None):
"--database", dest="database", type=str, help="name of database to use"
)
parser.add_argument(
"--mongo-uri", dest="mongo_uri", type=str, help="URI to use to connect to Mongo"
"--mongo_uri", dest="mongo_uri", type=str, help="URI to use to connect to Mongo"
)
parser.add_argument("--timezone", dest="timezone", type=str, help="Local timezone")
parser.add_argument(
"--service-port",
"--service_port",
dest="service_port",
type=int,
help="port listen to for clients",
Expand Down
3 changes: 2 additions & 1 deletion conftrak/server/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ def db_connect(database, mongo_uri, testing=False):
else:
try:
client = pymongo.MongoClient(mongo_uri)
client.list_database_names() # check if the server is really okay.
# Proactively check that connection to server is working.
client.server_info()
except (
pymongo.errors.ConnectionFailure,
pymongo.errors.ServerSelectionTimeoutError,
Expand Down
2 changes: 1 addition & 1 deletion conftrak/test/test_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def test_parse_configuration():
"prog",
"--database",
"conftrak",
"--mongo-uri",
"--mongo_uri",
"mongodb://localhost",
"--timezone",
"US/Eastern",
Expand Down

0 comments on commit 9fbc029

Please sign in to comment.