From 74fec40e64d69715472804127e15d632e2f0b8ad Mon Sep 17 00:00:00 2001 From: Aaron Johnson Date: Sun, 15 Sep 2019 19:26:46 -0500 Subject: [PATCH] Cleanup: Removed test command --- commands.rb | 32 -------------------------------- run.rb | 2 -- 2 files changed, 34 deletions(-) diff --git a/commands.rb b/commands.rb index c2c0f28..2ad294f 100644 --- a/commands.rb +++ b/commands.rb @@ -60,7 +60,6 @@ end def process_command_location(message, command, adm) if message_from_admin?(message, adm) || is_chat_authorized?(message, @auth_chat) - #reply = "I am currently located at:\n\nHost: \\\`#{`head -n1 /etc/hostname`}\\\`ExtIP: \\\`#{`curl icanhazip.com 2>/dev/null`}\\\`" reply = "I am currently located at:\n\nHost: #{`head -n1 /etc/hostname`}ExtIP: #{`curl icanhazip.com 2>/dev/null`}" else reply = "I am not authorized to provide this information here." @@ -104,12 +103,7 @@ def process_command_report(message, command, adm, simple=false) @probes.each do |k,v| zone = v["loc"].to_s host = k - #print "#{host}: #{zone} " tdata = process_tdata(host, simple) - #tdata = `ssh #{host} heatbot_gettemp` - #print "[#{tdata}°#{@tunit}]\n" - #report = report + "#{zone}: #{tdata}°#{@tunit}\n" - #print "[#{tdata}]\n" report = report + "#{zone}: #{tdata}\n" STDOUT.flush end @@ -120,29 +114,3 @@ def process_command_report(message, command, adm, simple=false) send_message(message.chat.id,"I am not authorized to provide this information here.") end end - -def process_command_test(message, command, adm) - if is_chat_authorized?(message, @auth_chat) || message_from_admin?(message, adm) - #reply = `scripts/tempf.py` - #some interactive code to select a probe - select_loc = "Server Room: Intake" - #end interactive code - #probe = @probes[0] #set manually for now - reply = "" - hostdata = host_lookup(select_loc) - puts "var:".blue+" hostdata".blue.bold+"::".bold + hostdata.to_s - if ! hostdata.empty? - hostdata.each do |k,v| - puts "match:".blue+" host".blue.bold+"::".bold + k.to_s - reply += k.to_s+"\n" - end - else - reply = "No matching locations!" - puts "hostdata is empty!" - end - puts reply - else - reply = "I am not authorized to provide this information here." - end - return reply -end diff --git a/run.rb b/run.rb index 0e4bb8d..aa21548 100755 --- a/run.rb +++ b/run.rb @@ -372,8 +372,6 @@ def handle_message(message) #when '/sreport', '/simpler', '/simplereport', '/sr' when '/simple', '/s', '/sreport', '/simpler', '/simplereport', '/sr' process_command_report(message, command, adm, true) - when '/test' - process_command_test(message, command, adm) when '/pp', '/debug' pp message send_message(message.chat.id"Confirmation: Message debug information sent to console.")