CloudDeploy/CommandLine/ListDeployments.pm untested

filter: Statementstmt 0.0% 0 / 15 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 3 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 21 CC 2 SCAR 13.9
CC
2
Cov
0%
run
6.0
BEGIN
2.0
BEGIN
2.0
CRAP 4.0
1 package CloudDeploy::CommandLine::ListDeployments {
2 use MooseX::App;
3 use CloudDeploy::DeploymentCollection;
4  
5 option extended => (
6 is => 'ro',
7 isa => 'Bool',
8 documentation => 'If specified, will list account, status and type of deploy',
9 default => 0,
10 );
11  
12 sub run {
13 my ($self) = @_;
14
15 my $deployments = CloudDeploy::DeploymentCollection->new(account => $ENV{'CPSD_AWS_ACCOUNT'});
16 my @list = $deployments->customer_deployments;
17
18 foreach my $deploy_name (@list) {
19 if ($self->extended) {
20 my $deploy = $deployments->get_deployment($deploy_name);
21 printf "%s\t%s\t%s\t%s\n", $deploy->name, $deploy->account, $deploy->status, $deploy->type
22 } else {
23 printf "%s\n", $deploy_name;
24 }
25 }
26 }
27 }
28  
29 1;
30