Method: InstanceAgent::Plugins::CodeDeployPlugin::CommandPoller#next_command

Defined in:
lib/instance_agent/plugins/codedeploy/command_poller.rb

#next_commandObject



81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# File 'lib/instance_agent/plugins/codedeploy/command_poller.rb', line 81

def next_command
  log(:debug, "Calling PollHostCommand:")
  output = @deploy_control_client.poll_host_command(:host_identifier => @host_identifier)
  command = output.host_command
  if command.nil?
    log(:debug, "PollHostCommand: Host Command =  nil")
  else
    log(:debug, "PollHostCommand: "  +
    "Host Identifier = #{command.host_identifier}; "  +
    "Host Command Identifier = #{command.host_command_identifier}; "  +
    "Deployment Execution ID = #{command.deployment_execution_id}; "  +
    "Command Name = #{command.command_name}")
    raise "Host Identifier mismatch: #{@host_identifier} != #{command.host_identifier}" unless @host_identifier.include? command.host_identifier
    raise "Command Name missing" if command.command_name.nil? || command.command_name.empty?
  end
  command
end