File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
vendor/gems/codedeploy-commands-1.0.0/lib/aws/plugins Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -2,16 +2,19 @@ module Aws
2
2
module Plugins
3
3
class DeployAgentVersion < Seahorse ::Client ::Plugin
4
4
class Handler < Seahorse ::Client ::Handler
5
- def call ( context )
5
+ def initialize ( handler = nil )
6
+ @handler = handler
6
7
file_path = File . join ( ProcessManager ::Config . config [ :version_dir ] , '.version' )
7
8
if File . exist? ( file_path )
8
- agent_version = File . read ( file_path ) . chomp . split ( ': ' ) . last
9
+ @ agent_version || = File . read ( file_path ) . split ( ': ' ) . last . strip
9
10
else
10
- agent_version = "UNKNOWN_VERSION"
11
+ @ agent_version || = "UNKNOWN_VERSION"
11
12
log ( :warn , "Version tracking file doesn't exist in directory #{ file_path } " )
12
13
end
14
+ end
13
15
14
- context . http_request . headers [ 'x-amz-codedeploy-agent-version' ] = agent_version
16
+ def call ( context )
17
+ context . http_request . headers [ 'x-amz-codedeploy-agent-version' ] = @agent_version
15
18
@handler . call ( context )
16
19
end
17
20
You can’t perform that action at this time.
0 commit comments