Simplify and correct comparisons with None.

This commit is contained in:
Blair Zajac 2013-02-09 15:49:54 -08:00 committed by Michael DeHaan
parent 2172201795
commit fa8e653011
10 changed files with 16 additions and 16 deletions

View file

@ -285,7 +285,7 @@ def main():
module.fail_json(msg="when supplying login arguments, both login_user and login_password must be provided")
try:
if module.params["login_unix_socket"] != None:
if module.params["login_unix_socket"]:
db_connection = MySQLdb.connect(host=module.params["login_host"], unix_socket=module.params["login_unix_socket"], user=login_user, passwd=login_password, db="mysql")
else:
db_connection = MySQLdb.connect(host=module.params["login_host"], user=login_user, passwd=login_password, db="mysql")