fix: prevent nomos CLI from connecting to DB when not required (#1299) - #2947
shaheemazmalmmd merged 1 commit into
Conversation
dvjsharma
left a comment
There was a problem hiding this comment.
Hi @SalmanDeveloperz. Haven't tested the PR yet, PTAL at the comments.
Kaushl2208
left a comment
There was a problem hiding this comment.
Changes looks good, Needs test :)
|
@SalmanDeveloperz : please change the commit message according to our contributing guidelines |
85faebe to
73c135b
Compare
|
Hi @shaheemazmalmmd , Commit message updated as per the guidelines. Please let me know if any other changes are needed. |
|
Hey @SalmanDeveloperz , Commit message is good but you still need to sign-off your commit. Take a look at Signing Commits Once those are done. It can be merged. |
73c135b to
3a7cd28
Compare
|
Hey @Kaushl2208 , |
…fossology#1299) Signed-off-by: Muhammad Salman <chsalmanramzan422@gmail.com>
3a7cd28 to
fcf95aa
Compare
Description
This pull request addresses issue #1299 by preventing the
nomosCLI from attempting to read theDb.conffile when a database connection is not required. Specifically, the CLI no longer tries to open a DB connection when displaying the help message (-hflag), which previously caused a permission error.Changes
should_connect_to_dbinlibfossscheduler.cto control whether a database connection should be initiated.Usage()function innomos.utils.cto setshould_connect_to_db = 0when the help command (-h) is used.fo_scheduler_connect_conf()function to respect this flag, ensuring the database connection is only attempted when necessary.How to test
-h):Run the following command to verify that the help message is displayed without any DB connection attempt or permission error: