Bugfix 60043: turn off the default db warning where it doesn't make sense (#60105)
This commit is contained in:
parent
aecdfd397e
commit
d2cc9f5f06
4 changed files with 15 additions and 4 deletions
|
@ -271,7 +271,7 @@ def main():
|
|||
fail_on_role = module.params['fail_on_role']
|
||||
state = module.params['state']
|
||||
|
||||
conn_params = get_conn_params(module, module.params)
|
||||
conn_params = get_conn_params(module, module.params, warn_db_default=False)
|
||||
db_connection = connect_to_db(module, conn_params, autocommit=False)
|
||||
cursor = db_connection.cursor(cursor_factory=DictCursor)
|
||||
|
||||
|
|
|
@ -129,7 +129,7 @@ def main():
|
|||
server_version=dict(),
|
||||
)
|
||||
|
||||
conn_params = get_conn_params(module, module.params)
|
||||
conn_params = get_conn_params(module, module.params, warn_db_default=False)
|
||||
db_connection = connect_to_db(module, conn_params, fail_on_conn=False)
|
||||
|
||||
if db_connection is not None:
|
||||
|
|
|
@ -231,7 +231,18 @@ def main():
|
|||
if immediately_reserve and slot_type == 'logical':
|
||||
module.fail_json(msg="Module parameters immediately_reserve and slot_type=logical are mutually exclusive")
|
||||
|
||||
conn_params = get_conn_params(module, module.params)
|
||||
# When slot_type is logical and parameter db is not passed,
|
||||
# the default database will be used to create the slot and
|
||||
# the user should know about this.
|
||||
# When the slot type is physical,
|
||||
# it doesn't matter which database will be used
|
||||
# because physical slots are global objects.
|
||||
if slot_type == 'logical':
|
||||
warn_db_default = True
|
||||
else:
|
||||
warn_db_default = False
|
||||
|
||||
conn_params = get_conn_params(module, module.params, warn_db_default=warn_db_default)
|
||||
db_connection = connect_to_db(module, conn_params, autocommit=True)
|
||||
cursor = db_connection.cursor(cursor_factory=DictCursor)
|
||||
|
||||
|
|
|
@ -395,7 +395,7 @@ def main():
|
|||
module.fail_json(msg="state=absent is mutually exclusive location, "
|
||||
"owner, rename_to, and set")
|
||||
|
||||
conn_params = get_conn_params(module, module.params)
|
||||
conn_params = get_conn_params(module, module.params, warn_db_default=False)
|
||||
db_connection = connect_to_db(module, conn_params, autocommit=True)
|
||||
cursor = db_connection.cursor(cursor_factory=DictCursor)
|
||||
|
||||
|
|
Loading…
Reference in a new issue