Project

General

Profile

« Previous | Next » 

Revision 0f35c707

Added by Brian Gupta about 12 years ago

  • ID 0f35c70718d4438d61455119c4908b0cc14614fd

Compute Resource menu was shown only if libvirt bindings were installed

View differences:

app/helpers/home_helper.rb
['Smart Proxies', :smart_proxies]
]
choices += [
[:divider],
['Compute Resources', :compute_resources],
['Hypervisors', :hypervisors]
] if SETTINGS[:libvirt]
if SETTINGS[:unattended]
choices += [
[:divider],
['Compute Resources', :compute_resources]
]
choices += [
[:divider],
['Architectures', :architectures],
['Domains', :domains],
['Hardware Models', :models],
['Installation Media', :media],
['Operating Systems', :operatingsystems],
['Partition Tables', :ptables],
['Provisioning Templates', :config_templates],
['Subnets', :subnets]
] if SETTINGS[:unattended]
choices += [ ['Hypervisors', :hypervisors ] ] if SETTINGS[:libvirt]
choices += [
[:divider],
['Architectures', :architectures],
['Domains', :domains],
['Hardware Models', :models],
['Installation Media', :media],
['Operating Systems', :operatingsystems],
['Partition Tables', :ptables],
['Provisioning Templates', :config_templates],
['Subnets', :subnets]
]
end
choices += [
[:divider],
app/models/compute_resource.rb
require 'server_interfaces'
class ComputeResource < ActiveRecord::Base
PROVIDERS = %w[ Libvirt Ovirt EC2 Vmware ]
PROVIDERS = %w[ Libvirt Ovirt EC2 Vmware ].delete_if{|p| p == "Libvirt" && !SETTINGS[:libvirt]}
acts_as_audited :except => [:password]
# to STI avoid namespace issues when loading the class, we append Foreman::Model in our database type column

Also available in: Unified diff