Method: ScoutAgent::Assignment::Update#execute

Defined in:
lib/scout_agent/assignment/update.rb

#executeObject

Runs the update command.



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/scout_agent/assignment/update.rb', line 19

def execute
  begin
    Plan.config_file.unlink
    puts "Identification file '#{Plan.config_file}' removed."
  rescue Errno::EACCES
    abort_with_sudo_required
  end
  if Plan.write_default_config_file
    puts "Identification file '#{Plan.config_file}' replaced."
  else
    if Plan.config_file.exist?
      puts "Identification file '#{Plan.config_file}' exists.  Skipped."
    else
      abort_with_sudo_required
    end
  end
end