mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-11 13:40:07 +00:00
Make Agent.username and .hostname optional so they can be loaded from a minimal agent file and updated at runtime.
This commit is contained in:
@@ -1247,14 +1247,18 @@ has 'uuid' => (
|
|||||||
has 'username' => (
|
has 'username' => (
|
||||||
is => 'rw',
|
is => 'rw',
|
||||||
isa => 'Str',
|
isa => 'Str',
|
||||||
required => 1,
|
required => 0,
|
||||||
default => sub { return $ENV{USER} || $ENV{LOGNAME} },
|
default => sub { return $ENV{USER} || $ENV{LOGNAME} },
|
||||||
);
|
);
|
||||||
|
|
||||||
has 'hostname' => (
|
has 'hostname' => (
|
||||||
is => 'rw',
|
is => 'rw',
|
||||||
isa => 'Str',
|
isa => 'Str',
|
||||||
required => 1,
|
required => 0,
|
||||||
|
default => sub {
|
||||||
|
chomp(my $hostname = `hostname`);
|
||||||
|
return $hostname;
|
||||||
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
has 'alias' => (
|
has 'alias' => (
|
||||||
|
@@ -31,14 +31,18 @@ has 'uuid' => (
|
|||||||
has 'username' => (
|
has 'username' => (
|
||||||
is => 'rw',
|
is => 'rw',
|
||||||
isa => 'Str',
|
isa => 'Str',
|
||||||
required => 1,
|
required => 0,
|
||||||
default => sub { return $ENV{USER} || $ENV{LOGNAME} },
|
default => sub { return $ENV{USER} || $ENV{LOGNAME} },
|
||||||
);
|
);
|
||||||
|
|
||||||
has 'hostname' => (
|
has 'hostname' => (
|
||||||
is => 'rw',
|
is => 'rw',
|
||||||
isa => 'Str',
|
isa => 'Str',
|
||||||
required => 1,
|
required => 0,
|
||||||
|
default => sub {
|
||||||
|
chomp(my $hostname = `hostname`);
|
||||||
|
return $hostname;
|
||||||
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
has 'alias' => (
|
has 'alias' => (
|
||||||
|
Reference in New Issue
Block a user