lib/WWW/Hetzner/CLI/Cmd/StorageBox/Cmd/Subaccount/Cmd/ResetPassword.pm

filter: Statementstmt 100% 23 / 23 Branchbran 50.0% 3 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 0.0% 0 / 1 totaltotal 88.5% 31 / 35 CC 4 SCAR 9.5
CC
4
Cov
90%
execute
4.2
BEGIN
1.0
BEGIN
1.0
CRAP 2.6
« lib/WWW/Hetzner/CLI/Cmd/StorageBox/Cmd/Subaccount/Cmd/ChangeHomeDirectory.pm ↑ Summary lib/WWW/Hetzner/CLI/Cmd/Record/Cmd/Describe.pm »
1 package WWW::Hetzner::CLI::Cmd::StorageBox::Cmd::Subaccount::Cmd::ResetPassword;
2 # ABSTRACT: Reset a Storage Box subaccount password
3  
4 1 our $VERSION = '0.102';
5  
6 1 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 ▶use MooX::Cmd;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶use MooX::Options protect_argv => 0, usage_string => 'USAGE: hcloud.pl storage-box subaccount reset-password --password <password> <storage-box> <subaccount>';
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 ▶use WWW::Hetzner::Storage::API::Subaccounts;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 1 with 'WWW::Hetzner::CLI::Role::WaitsForAction';
11  
12  
13 1 option password => (
14 is => 'ro',
15 format => 's',
16 required => 1,
17 doc => 'New subaccount password (input only)',
18 );
19  
20 1 ▶sub execute {
Subroutine execute: called CC=4 SCAR=14.3
Pod undocumented
21 1 my ($self, $args, $chain) = @_;
22 1 ▶ my $id = $args->[0] or die "Usage: hcloud.pl storage-box subaccount reset-password <storage-box> <subaccount>\n";
Branch: 1 branch
BranchTrueFalseTotal
my $id = $args->[0] or die "Usage: hcloud.pl storage-box subaccount reset-password <storage-box> <subaccount>\n" 1 0 1
23 1 ▶ my $sub = $args->[1] or die "Usage: hcloud.pl storage-box subaccount reset-password <storage-box> <subaccount>\n";
Branch: 1 branch
BranchTrueFalseTotal
my $sub = $args->[1] or die "Usage: hcloud.pl storage-box subaccount reset-password <storage-box> <subaccount>\n" 1 0 1
24  
25 1 my $subaccounts = WWW::Hetzner::Storage::API::Subaccounts->new(
26 client => $chain->[0]->storage,
27 storage_box_id => $id,
28 );
29 1 my $action = $subaccounts->reset_subaccount_password($sub, password => $self->password);
30 1 $self->handle_action($action);
31 1 ▶ print $self->no_wait ? "Subaccount password reset requested.\n" : "Subaccount password reset.\n";
Branch: 1 branch
BranchTrueFalseTotal
$self->no_wait ? : 1 0 1
32 }
33  
34 1 1;
35  
36 __END__
« lib/WWW/Hetzner/CLI/Cmd/StorageBox/Cmd/Subaccount/Cmd/ChangeHomeDirectory.pm ↑ Summary lib/WWW/Hetzner/CLI/Cmd/Record/Cmd/Describe.pm »