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

Tiny fixes in mysql checks #293

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Tiny fixes in mysql checks #293

wants to merge 1 commit into from

Conversation

v0devil
Copy link
Member

@v0devil v0devil commented Aug 28, 2023

src/check_mysql_conf.py: Empty files with only [mysqld] line are producing an error in pt-config-diff - checking if there is at least one non-empty line in the config file.

Copy link
Contributor

@kofrezo kofrezo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use the configparser module here instead of building your own code :-)

@@ -60,6 +60,18 @@ def parse_args():

return parser.parse_args()

def check_config_file(conf_fd):
Copy link
Contributor

@kofrezo kofrezo Aug 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def check_config_file(conf_fd):
def check_config_file(conf_fd):
# Import configparser module on top
config = configparser.ConfigParser()
config.read_file(conf_fd)
return config.has_section('mysqld')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants