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
22 module Plugins
33 class DeployAgentVersion < Seahorse ::Client ::Plugin
44 class Handler < Seahorse ::Client ::Handler
5- def call ( context )
5+ def initialize ( handler = nil )
6+ @handler = handler
67 file_path = File . join ( ProcessManager ::Config . config [ :version_dir ] , '.version' )
78 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
910 else
10- agent_version = "UNKNOWN_VERSION"
11+ @ agent_version || = "UNKNOWN_VERSION"
1112 log ( :warn , "Version tracking file doesn't exist in directory #{ file_path } " )
1213 end
14+ end
1315
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
1518 @handler . call ( context )
1619 end
1720
You can’t perform that action at this time.
0 commit comments