mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-12 06:00:14 +00:00
Fix init_config_file() when config file doesn't exist yet.
This commit is contained in:
@@ -6242,8 +6242,8 @@ sub init_config_file {
|
|||||||
|
|
||||||
my $config_file = get_config_file();
|
my $config_file = get_config_file();
|
||||||
eval {
|
eval {
|
||||||
die "$config_file is not writable\n"
|
die "$config_file exists but is not writable\n"
|
||||||
unless -w $config_file;
|
if -f $config_file && !-w $config_file;
|
||||||
open my $fh, '>', $config_file
|
open my $fh, '>', $config_file
|
||||||
or die "Error opening $config_file: $OS_ERROR";
|
or die "Error opening $config_file: $OS_ERROR";
|
||||||
print { $fh } "api-key=$api_key\n"
|
print { $fh } "api-key=$api_key\n"
|
||||||
|
Reference in New Issue
Block a user