summaryrefslogtreecommitdiffstats
path: root/cloudmasterd/lib/cloudmasterd.rb
diff options
context:
space:
mode:
Diffstat (limited to 'cloudmasterd/lib/cloudmasterd.rb')
-rw-r--r--cloudmasterd/lib/cloudmasterd.rb13
1 files changed, 11 insertions, 2 deletions
diff --git a/cloudmasterd/lib/cloudmasterd.rb b/cloudmasterd/lib/cloudmasterd.rb
index fe94972..89a2e1e 100644
--- a/cloudmasterd/lib/cloudmasterd.rb
+++ b/cloudmasterd/lib/cloudmasterd.rb
@@ -100,6 +100,7 @@ module Cloudmasterd::Models
def self.up
create_table :cloudmasterd_cloud do |t|
t.column :name, :string, :null => false, :limit => 255
+ t.column :virttype, :string, :limit => 255
t.column :memory, :integer, :null => false
t.column :added_date, :datetime, :null => true
end
@@ -216,6 +217,14 @@ module Cloudmasterd::Controllers
@memory = Cloud.sum('memory')
@cloud_machines = Cloud.find(:all)
+ @cloud_names = {}
+ @cloud_machines.each do |machine|
+ printed_name = machine.name
+ if machine.type
+ printed_name += (machine.type == "Xen") ? " (Xen)": " (KVM)"
+ end
+ @cloud_names[machine.name] = printed_name
+ end
render :status
end
@@ -262,7 +271,7 @@ module Cloudmasterd::Views
end
@cloud_machines.each do |machine|
tr do
- td machine.name
+ td @cloud_names[machine.name]
td machine.memory
unless machine.added_date == nil then
td machine.added_date.strftime("%m/%d/%Y")
@@ -296,7 +305,7 @@ module Cloudmasterd::Views
a name
end
end
- td machine.cloud
+ td @cloud_names[machine.cloud]
td machine.state
unless machine.created_date == nil then
td machine.created_date.strftime("%m/%d/%Y")