Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Harmonize kwargs and client check #9

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading