From d3486a16c8b9704be8cc33de49aafa59b7503d57 Mon Sep 17 00:00:00 2001 From: Andrew Klychkov Date: Tue, 13 Oct 2020 10:29:39 +0300 Subject: [PATCH] fix CI --- plugins/module_utils/mysql.py | 2 +- .../test_mysql_db/tasks/config_overrides_defaults.yml | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/plugins/module_utils/mysql.py b/plugins/module_utils/mysql.py index 6d56089..09e0338 100644 --- a/plugins/module_utils/mysql.py +++ b/plugins/module_utils/mysql.py @@ -35,7 +35,7 @@ mysql_driver_fail_msg = 'The PyMySQL (Python 2.7 and Python 3.X) or MySQL-python def parse_from_mysql_config_file(cnf): # Default values of comment_prefix is '#' and ';'. # '!' added to prevent a parsing error - # when a config file contains !include_dir parameter. + # when a config file contains !includedir parameter. cp = configparser.ConfigParser(comment_prefixes=('#', ';', '!')) cp.read(cnf) return cp diff --git a/tests/integration/targets/test_mysql_db/tasks/config_overrides_defaults.yml b/tests/integration/targets/test_mysql_db/tasks/config_overrides_defaults.yml index 7e858f1..13e8f17 100644 --- a/tests/integration/targets/test_mysql_db/tasks/config_overrides_defaults.yml +++ b/tests/integration/targets/test_mysql_db/tasks/config_overrides_defaults.yml @@ -11,6 +11,9 @@ - name: Add fake port to config file shell: 'echo "port = {{ fake_port }}" >> {{ config_file }}' +- name: Add blank line + shell: 'echo "" >> {{ config_file }}' + - name: Create include_dir file: path: '{{ include_dir }}' @@ -18,7 +21,10 @@ mode: '0777' - name: Add include_dir - shell: 'echo "!include_dir {{ include_dir }}" >> {{ config_file }}' + lineinfile: + path: '{{ config_file }}' + line: '!includedir {{ include_dir }}' + insertafter: EOF - name: Create database using fake port to connect to, must fail mysql_db: