mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-11 21:51:21 +00:00
Change Agent.user to Agent.username and make it and hostname rw.
This commit is contained in:
17
bin/pt-agent
17
bin/pt-agent
@@ -1244,8 +1244,15 @@ has 'uuid' => (
|
|||||||
required => 0,
|
required => 0,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
has 'username' => (
|
||||||
|
is => 'rw',
|
||||||
|
isa => 'Str',
|
||||||
|
required => 1,
|
||||||
|
default => $ENV{USER} || $ENV{LOGNAME},
|
||||||
|
);
|
||||||
|
|
||||||
has 'hostname' => (
|
has 'hostname' => (
|
||||||
is => 'ro',
|
is => 'rw',
|
||||||
isa => 'Str',
|
isa => 'Str',
|
||||||
required => 1,
|
required => 1,
|
||||||
);
|
);
|
||||||
@@ -1256,12 +1263,6 @@ has 'alias' => (
|
|||||||
required => 0,
|
required => 0,
|
||||||
);
|
);
|
||||||
|
|
||||||
has 'user' => (
|
|
||||||
is => 'ro',
|
|
||||||
isa => 'Str',
|
|
||||||
required => 1,
|
|
||||||
);
|
|
||||||
|
|
||||||
has 'versions' => (
|
has 'versions' => (
|
||||||
is => 'ro',
|
is => 'ro',
|
||||||
isa => 'Maybe[HashRef]',
|
isa => 'Maybe[HashRef]',
|
||||||
@@ -5052,7 +5053,7 @@ sub init_agent {
|
|||||||
# Other optional attribs, like versions, are left to the caller.
|
# Other optional attribs, like versions, are left to the caller.
|
||||||
chomp(my $hostname = `hostname`);
|
chomp(my $hostname = `hostname`);
|
||||||
$agent->{hostname} = $hostname;
|
$agent->{hostname} = $hostname;
|
||||||
$agent->{user} = $ENV{USER} || $ENV{LOGNAME};
|
$agent->{username} = $ENV{USER} || $ENV{LOGNAME};
|
||||||
|
|
||||||
# Try forever to create/update the Agent. The tool can't
|
# Try forever to create/update the Agent. The tool can't
|
||||||
# do anything without an Agent, so we must succeed to proceed.
|
# do anything without an Agent, so we must succeed to proceed.
|
||||||
|
@@ -28,8 +28,15 @@ has 'uuid' => (
|
|||||||
required => 0,
|
required => 0,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
has 'username' => (
|
||||||
|
is => 'rw',
|
||||||
|
isa => 'Str',
|
||||||
|
required => 1,
|
||||||
|
default => $ENV{USER} || $ENV{LOGNAME},
|
||||||
|
);
|
||||||
|
|
||||||
has 'hostname' => (
|
has 'hostname' => (
|
||||||
is => 'ro',
|
is => 'rw',
|
||||||
isa => 'Str',
|
isa => 'Str',
|
||||||
required => 1,
|
required => 1,
|
||||||
);
|
);
|
||||||
@@ -40,12 +47,6 @@ has 'alias' => (
|
|||||||
required => 0,
|
required => 0,
|
||||||
);
|
);
|
||||||
|
|
||||||
has 'user' => (
|
|
||||||
is => 'ro',
|
|
||||||
isa => 'Str',
|
|
||||||
required => 1,
|
|
||||||
);
|
|
||||||
|
|
||||||
has 'versions' => (
|
has 'versions' => (
|
||||||
is => 'ro',
|
is => 'ro',
|
||||||
isa => 'Maybe[HashRef]',
|
isa => 'Maybe[HashRef]',
|
||||||
|
Reference in New Issue
Block a user