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

Holland mysqldump fails to expand ~ causing it to fail to detect a sql credentials file that does exist. #131

Open
sjafferali opened this issue May 24, 2016 · 0 comments

Comments

@sjafferali
Copy link

[root@hcluster1-db2 plugins]# ./holland_mysqldump.py
status success holland checked
metric log_age int64 138
metric dump_age int64 139
metric error_count int64 0
metric first_error string none
metric last_error string none
metric sql_creds_exist string false
metric sql_ping_succeeds string true
metric sql_status_succeeds string true
[root@hcluster1-db2 plugins]#

Although, we can see my credentials file is defined as ~/my.cnf.

[root@hcluster1-db2 plugins]# grep ^defaults /etc/holland/backupsets/default.conf
defaults-extra-file = ~/.my.cnf,
[root@hcluster1-db2 plugins]#

And this file does indeed exist.

[root@hcluster1-db2 plugins]# stat ~/.my.cnf
  File: ‘/root/.my.cnf’
  Size: 87          Blocks: 8          IO Block: 4096   regular file
Device: ca01h/51713d    Inode: 786463      Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2016-05-18 18:06:54.239755077 -0500
Modify: 2016-05-18 18:06:54.239755077 -0500
Change: 2016-05-18 18:06:54.239755077 -0500
 Birth: -
[root@hcluster1-db2 plugins]#

Switching this to /root/.my.cnf file seems to be a good work around to make this detect the file properly.

[root@hcluster1-db2 plugins]# grep ^defaults /etc/holland/backupsets/default.conf
defaults-extra-file = /root/.my.cnf,
[root@hcluster1-db2 plugins]# ./holland_mysqldump.py
status success holland checked
metric log_age int64 335
metric dump_age int64 336
metric error_count int64 0
metric first_error string none
metric last_error string none
metric sql_creds_exist string true
metric sql_ping_succeeds string true
metric sql_status_succeeds string true
[root@hcluster1-db2 plugins]#

Although, as a more permanent solution, I ended up modifying line 144 from:

                if os.access(f, os.F_OK):

To:

                if os.access(os.path.expanduser(f), os.F_OK):

Pull request to follow.

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 a pull request may close this issue.

1 participant