line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Clustericious::Command::configdump; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
571
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
25
|
|
4
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
19
|
|
5
|
1
|
|
|
1
|
|
13
|
use 5.010001; |
|
1
|
|
|
|
|
3
|
|
6
|
1
|
|
|
1
|
|
5
|
use Mojo::Base 'Clustericious::Command'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
7
|
1
|
|
|
1
|
|
122
|
use Clustericious::Config; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
18
|
|
8
|
1
|
|
|
1
|
|
4
|
use YAML::XS qw( Dump ); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
240
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
# ABSTRACT: Dump a clustericious configuration |
11
|
|
|
|
|
|
|
our $VERSION = '1.27'; # VERSION |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
has description => <<EOT; |
15
|
|
|
|
|
|
|
Dump clustericious configuration |
16
|
|
|
|
|
|
|
EOT |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
has usage => <<EOT; |
19
|
|
|
|
|
|
|
usage $0: configdump [ app ] |
20
|
|
|
|
|
|
|
EOT |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub run |
23
|
|
|
|
|
|
|
{ |
24
|
0
|
|
|
0
|
1
|
|
my($self, $name) = @_; |
25
|
0
|
|
0
|
|
|
|
my $app_name = $name // ref($self->app); |
26
|
|
|
|
|
|
|
|
27
|
0
|
|
|
|
|
|
my $config = eval { |
28
|
|
|
|
|
|
|
Clustericious::Config->new($app_name, sub { |
29
|
0
|
|
|
0
|
|
|
my($type, $name) = @_; |
30
|
0
|
0
|
|
|
|
|
if($type eq 'not_found') |
31
|
|
|
|
|
|
|
{ |
32
|
0
|
|
|
|
|
|
say STDERR "ERROR: unable to find $name"; |
33
|
0
|
|
|
|
|
|
exit 2; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
}) |
36
|
0
|
|
|
|
|
|
}; |
37
|
|
|
|
|
|
|
|
38
|
0
|
0
|
|
|
|
|
if(my $error = $@) |
39
|
|
|
|
|
|
|
{ |
40
|
0
|
|
|
|
|
|
say STDERR "ERROR: in syntax: $error"; |
41
|
0
|
|
|
|
|
|
exit 2; |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
else |
44
|
|
|
|
|
|
|
{ |
45
|
0
|
|
|
|
|
|
print Dump({ %$config }); |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
}; |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
1; |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
__END__ |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=pod |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=encoding UTF-8 |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=head1 NAME |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
Clustericious::Command::configdump - Dump a clustericious configuration |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=head1 VERSION |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
version 1.27 |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=head1 SYNOPSIS |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
Given a L<YourApp> clustericious L<Clustericious::App> and C<yourapp> starter script: |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
% yourapp configdump |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
or |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
% clustericious configdump YourApp |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=head1 DESCRIPTION |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
This command prints out the post-processed configuration in L<YAML> format. |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=head1 SEE ALSO |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
L<Clustericious::Config>, |
82
|
|
|
|
|
|
|
L<Clustericious> |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=head1 AUTHOR |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
Original author: Brian Duggan |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
Current maintainer: Graham Ollis E<lt>plicease@cpan.orgE<gt> |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
Contributors: |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
Curt Tilmes |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
Yanick Champoux |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
This software is copyright (c) 2013 by NASA GSFC. |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
101
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
=cut |