Cleanup: Removed test command

pull/2/head
Aaron Johnson 6 years ago
parent 6f1b7357de
commit 74fec40e64

@ -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

@ -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.")

Loading…
Cancel
Save