Permalink
Browse files

Remove /proc.txt and the PortaProc module

  • Loading branch information...
sodabrew committed Mar 8, 2014
1 parent 4f26c74 commit 8f6e17b18f41d3047ac7d1e23a1f9930eb0f1a81
Showing with 0 additions and 74 deletions.
  1. +0 −11 code/main.rb
  2. +0 −29 code/portaproc.rb
  3. +0 −7 code/views/proc_list.erb
  4. +0 −1 test/run_tests.sh
  5. +0 −26 test/test_portaproc.rb
View
@@ -6,7 +6,6 @@
require 'code/queueclient'
require 'code/errors'
require 'code/hashdir'
-require 'code/portaproc'
require 'code/overrides'
module RQ
@@ -149,16 +148,6 @@ def flash_now(type, msg)
RQ::QueueMgrClient.queues.to_json
end
- get '/proc.txt' do
- content_type 'text/plain', :charset => 'utf-8'
- ps = RQ::PortaProc.new
- ok, procs = ps.get_list
- if not ok
- throw :halt, [503, "503 - Could not get process list"]
- end
- erb :proc_list, :layout => false, :locals => {:queues => RQ::QueueMgrClient.queues, :procs => procs}
- end
-
get '/q/:name' do
if params[:name].index(".txt")
content_type 'text/plain', :charset => 'utf-8'
View
@@ -1,29 +0,0 @@
-module RQ
- class PortaProc
-
- attr_accessor :list
-
- def get_list
- @list = []
-
- # Cross-Platform ps command
- out = `/bin/ps -A -o uid,pid,ppid,sess,command 2>&1`
- if $?.exitstatus != 0
- return false,out
- end
-
- lines = out.split("\n")
-
- # mutator
- hdr = lines.shift
-
- items = lines.map { |i|
- f = i.split(" ", 5)
- h = { :uid => f[0], :pid => f[1], :ppid => f[2], :sess => f[3], :cmd => f[4] }
- }
-
- return true,items
- end
-
- end
-end
View
@@ -1,7 +0,0 @@
-
-----------------------------------------------------------------------------------
- UID PID PPID SESS COMMAND
-----------------------------------------------------------------------------------
-<%- procs.each do |proc| -%>
-<%= sprintf("%8s %8s %8s %8s %-80s", proc[:uid], proc[:pid], proc[:ppid], proc[:sess], proc[:cmd]) %>
-<%- end -%>
View
@@ -43,7 +43,6 @@ for test in \
test_htmlutils.rb \
test_jsonconfigfile.rb \
test_overrides.rb \
- test_portaproc.rb \
test_rule_processor.rb \
\
test_rq.sh \
View
@@ -1,26 +0,0 @@
-#!/usr/bin/env ruby
-$: << File.expand_path('..', File.dirname(__FILE__))
-
-require 'test/unit'
-require 'code/portaproc'
-
-class TC_PortaProcTest < Test::Unit::TestCase
-
- def test_get_list
- ps = RQ::PortaProc.new
-
- ok,res = ps.get_list
-
- assert(ok, "Error: Couldn't run command. - #{res}")
-
- assert((res.length > 0), "Error: Results empty")
-
- assert((res[0].has_key?(:uid)), "Error: missing uid field")
- assert((res[0].has_key?(:pid)), "Error: missing pid field")
- assert((res[0].has_key?(:ppid)), "Error: missing ppid field")
- assert((res[0].has_key?(:sess)), "Error: missing sess field")
- assert((res[0].has_key?(:cmd)), "Error: missing cmd field")
- end
-
-end
-

0 comments on commit 8f6e17b

Please sign in to comment.