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

Remove cursor parameter since it's the default and breaks. #53326

Open
wants to merge 2 commits into
base: devel
from

Conversation

Projects
None yet
3 participants
@mmriis
Copy link

mmriis commented Mar 5, 2019

SUMMARY

mysql_replication module gave an error. It sets the same cursorclass as in the module_utils/mysql.py and removing this redundant parameter fixes the error.

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

mysql_replication

ADDITIONAL INFORMATION

mysql_replication module didn't work for me. It gave me the following error using this task:

- name: test
  mysql_replication:
    mode: getmaster
The full traceback is:
  File "/tmp/ansible_mysql_replication_payload_88feug8a/__main__.py", line 245, in main
    connect_timeout=connect_timeout)
  File "/tmp/ansible_mysql_replication_payload_88feug8a/ansible_mysql_replication_payload.zip/ansible/module_utils/mysql.py", line 78, in mysql_connect
    return db_connection.cursor(cursorclass=mysql_driver.cursors.DictCursor)

fatal: [db01]: FAILED! => {
    "changed": false,
    "invocation": {
        "module_args": {
            "config_file": "/root/.my.cnf",
            "connect_timeout": 30,
            "login_host": "localhost",
            "login_password": null,
            "login_port": 3306,
            "login_unix_socket": null,
            "login_user": null,
            "master_auto_position": false,
            "master_connect_retry": null,
            "master_host": null,
            "master_log_file": null,
            "master_log_pos": null,
            "master_password": null,
            "master_port": null,
            "master_ssl": false,
            "master_ssl_ca": null,
            "master_ssl_capath": null,
            "master_ssl_cert": null,
            "master_ssl_cipher": null,
            "master_ssl_key": null,
            "master_user": null,
            "mode": "getmaster",
            "relay_log_file": null,
            "relay_log_pos": null,
            "ssl_ca": null,
            "ssl_cert": null,
            "ssl_key": null
        }
    },
    "msg": "unable to find /root/.my.cnf. Exception message: cursor() got an unexpected keyword argument 'cursorclass'"
}
@ansibot

This comment has been minimized.

Copy link
Contributor

ansibot commented Mar 5, 2019

The test ansible-test sanity --test pylint [explain] failed with 1 error:

lib/ansible/modules/database/mysql/mysql_replication.py:260:112: trailing-whitespace Trailing whitespace

The test ansible-test sanity --test pep8 [explain] failed with 1 error:

lib/ansible/modules/database/mysql/mysql_replication.py:260:113: W291 trailing whitespace

click here for bot help

@ansibot

This comment has been minimized.

Morten Møller Riis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.