line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# ABSTRACT: Lock a stack to prevent future changes |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
package Pinto::Action::Lock; |
4
|
|
|
|
|
|
|
|
5
|
5
|
|
|
5
|
|
4460
|
use Moose; |
|
5
|
|
|
|
|
19
|
|
|
5
|
|
|
|
|
88
|
|
6
|
5
|
|
|
5
|
|
42275
|
use MooseX::StrictConstructor; |
|
5
|
|
|
|
|
15
|
|
|
5
|
|
|
|
|
90
|
|
7
|
5
|
|
|
5
|
|
18335
|
use MooseX::MarkAsMethods ( autoclean => 1 ); |
|
5
|
|
|
|
|
19
|
|
|
5
|
|
|
|
|
80
|
|
8
|
|
|
|
|
|
|
|
9
|
5
|
|
|
5
|
|
18761
|
use Pinto::Types qw(StackName StackDefault StackObject); |
|
5
|
|
|
|
|
13
|
|
|
5
|
|
|
|
|
118
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
#------------------------------------------------------------------------------ |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
our $VERSION = '0.13'; # VERSION |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
#------------------------------------------------------------------------------ |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
extends qw( Pinto::Action ); |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
#------------------------------------------------------------------------------ |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
with qw( Pinto::Role::Transactional ); |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
#------------------------------------------------------------------------------ |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
has stack => ( |
26
|
|
|
|
|
|
|
is => 'ro', |
27
|
|
|
|
|
|
|
isa => StackName | StackDefault | StackObject, |
28
|
|
|
|
|
|
|
default => undef, |
29
|
|
|
|
|
|
|
); |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
#------------------------------------------------------------------------------ |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub execute { |
34
|
|
|
|
|
|
|
my ($self) = @_; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
my $stack = $self->repo->get_stack( $self->stack ); |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
if ( $stack->is_locked ) { |
39
|
|
|
|
|
|
|
$self->warning("Stack $stack is already locked"); |
40
|
|
|
|
|
|
|
return $self->result; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
$stack->lock; |
44
|
|
|
|
|
|
|
return $self->result->changed; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
#------------------------------------------------------------------------------ |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
#------------------------------------------------------------------------------ |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
1; |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
__END__ |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=pod |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=encoding UTF-8 |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=for :stopwords Jeffrey Ryan Thalhammer |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=head1 NAME |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
Pinto::Action::Lock - Lock a stack to prevent future changes |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=head1 VERSION |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
version 0.13 |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=head1 AUTHOR |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
Jeffrey Ryan Thalhammer <jeff@stratopan.com> |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
This software is copyright (c) 2015 by Jeffrey Ryan Thalhammer. |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
80
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=cut |