summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrenton Leanhardt <bleanhar@redhat.com>2008-07-11 09:50:43 -0400
committerBrenton Leanhardt <bleanhar@redhat.com>2008-07-11 10:37:52 -0400
commitbecf08223e4c105f02120cb148f761e95db5487a (patch)
treec37003b745ca1ec7e9971cfdda98cd0ef5e91663
parent66d6e9851a94649f2b2484fcc4f2146d2606f913 (diff)
Removing the 'systems' functionality from genomed
This is provided directly via the 'get_status' call to the cobbler remote api
-rw-r--r--genomed/extra/genomed.spec2
-rw-r--r--genomed/lib/genomed.rb110
2 files changed, 1 insertions, 111 deletions
diff --git a/genomed/extra/genomed.spec b/genomed/extra/genomed.spec
index df803a8..67ba27f 100644
--- a/genomed/extra/genomed.spec
+++ b/genomed/extra/genomed.spec
@@ -7,7 +7,7 @@
Summary: Genome Repository daemon for machine configuration
Name: rubygem-%{gemname}
Version: 1.0.0
-Release: 7%{?dist}
+Release: 8%{?dist}
Group: Applications/System
License: GPLv2+
URL: http://fedorahosted.org/genome
diff --git a/genomed/lib/genomed.rb b/genomed/lib/genomed.rb
index f78180c..f3c84bd 100644
--- a/genomed/lib/genomed.rb
+++ b/genomed/lib/genomed.rb
@@ -35,46 +35,6 @@ Camping.goes :Genomed
Genomed.picnic!
module Genomed::Controllers
- class Systems < REST 'systems'
- # OMG, this is ugly
- def _get_cobbler_installed_systems
- systems = {}
- `cat /var/log/cobbler/install.log | cut -f2-3`.each do |line|
- name, ip = line.split("\t")
- ip.chomp!
- name.chomp!
- hostname = _get_host_name(ip).chomp
- puts "name: #{name}, ip: #{ip}, hostname: #{hostname}"
-
- systems[name] = {"ip" => ip, "hostname" => hostname}
- end
- return systems
- end
-
- def _get_host_name(ip)
- lookup = `nslookup #{ip} | grep name | cut -f2`
- unless lookup.empty?
- return lookup.split("=")[1].strip.split(".").join(".")
- end
- end
-
- def read(name)
- name = CGI::unescape(name)
- @systems = _get_cobbler_installed_systems
- @system = {}
- if @systems.has_key?(name)
- @system = {"name" => name, "ip" => @systems[name]["ip"], "hostname" => @systems[name]["hostname"]}
- end
- render :view_system
- end
-
- def list
- @systems = _get_cobbler_installed_systems
- pp @systems
- render :list_systems
- end
- end
-
class MachineTypes < REST 'machine_types'
include GenomeDsl
@@ -191,7 +151,6 @@ module Genomed::Views
ul do
li { a("Machine Types", :href => CONTEXT + R(Genomed::Controllers::MachineTypes)) }
li { a("Nodes", :href => CONTEXT + R(Genomed::Controllers::Nodes)) }
- li { a("Systems", :href => CONTEXT + R(Genomed::Controllers::Systems)) }
end
end
div.content! do
@@ -261,17 +220,6 @@ module Genomed::Views
end
end
- def view_system
- h1 @system["name"]
-
- p do
- "IP Address: #{@system["ip"]} "
- end
- p do
- "Hostname: #{@system["hostname"]}"
- end
- end
-
def list_nodes
h1 "Nodes:"
p "To create a new node just browse to the page corresponding to the hostname. " +
@@ -301,34 +249,6 @@ module Genomed::Views
end
end
end
-
- def list_systems
- host = ENV["HOSTNAME"]
- cobbler_web = "http://#{host}/cobbler/web"
- h1 "Systems:"
- h4 do
- text("This information is gathered from the /var/log/cobbler/install.log file.\n")
- text("If you don't see what you're looking for, try ")
- a("cobbler web", :href => "#{cobbler_web}/?mode=system_list")
- end
-
- p do
- ol do
- @systems.each_key do |name|
- li do
- a(name, :href => URL("http://#{host}/#{CONTEXT}/systems/?id=#{name}"))
- text(" (")
- a("edit in cobbler", :href => "#{cobbler_web}/?mode=system_edit&name=#{name}")
- text(")")
- ul do
- li "ip: #{@systems[name]["ip"]}"
- li "hostname: #{@systems[name]["hostname"]}"
- end
- end
- end
- end
- end
- end
end
default_format :HTML
@@ -343,14 +263,6 @@ module Genomed::Views
def view_node
::YAML.dump(@info)
end
-
- def view_system
- ::YAML.dump(@system)
- end
-
- def list_systems
- ::YAML.dump(@systems)
- end
end
module XML
@@ -408,28 +320,6 @@ module Genomed::Views
@info["classes"].each {|c| @x.class(c)}
}
end
-
- def list_systems
- @x.instruct!
- @x.systems {
- @systems.each_key {|system|
- @x.system {
- @x.name(system)
- @x.ip(@systems[system]["ip"])
- @x.hostname(@systems[system]["hostname"])
- }
- }
- }
- end
-
- def view_system
- @x.instruct!
- @x.system {
- @x.name(@system["name"])
- @x.ip(@system["ip"])
- @x.hostname(@system["hostname"])
- }
- end
end
end