foreman.patch
foreman/app/models/compute_resource.rb 2013-03-08 05:23:07.701022850 -0500 | ||
---|---|---|
148 | 148 | |
149 | 149 |
def hardware_profile(id,opts={}) |
150 | 150 |
end |
151 |
|
|
152 |
def quotas(opts={}) |
|
153 |
end |
|
154 | ||
155 |
def quota(id,opts={}) |
|
156 |
end |
|
151 | 157 | |
152 | 158 |
def update_required?(old_attrs, new_attrs) |
153 | 159 |
old_attrs.merge(new_attrs) do |k,old_v,new_v| |
foreman/app/views/compute_resources_vms/form/ovirt/_volume.html.erb 2013-03-08 18:15:24.145000096 -0500 | ||
---|---|---|
7 | 7 |
<%= select_f f, :storage_domain, compute_resource.storage_domains, :id, :name, |
8 | 8 |
{ }, :label => 'Storage Domain', :disabled => disabled, :class => "span2", |
9 | 9 |
:help_inline=> remove_child_link("X", f, { :method => :'_delete', :title => 'remove volume', :class => 'label label-important' }) %> |
10 |
<%= select_f f, :quota, compute_resource.quotas, :id, :name, {}, |
|
11 |
{ :help_inline => image_tag('spinner.gif', :id => 'quota_indicator', :class => 'hide').html_safe, :help_block => "Quota to use"} %> |
|
12 |
<%= f.hidden_field :quota if disabled %> |
|
10 | 13 |
<%= f.hidden_field :storage_domain if disabled %> |
11 | 14 |
<%= f.hidden_field :id %> |
12 | 15 |
<%= field(f, :bootable, :label => 'Bootable') do |
... | ... | |
15 | 18 |
end %> |
16 | 19 |
<% end -%> |
17 | 20 |
</div> |
18 |
</div> |
|
21 |
</div> |
foreman/app/views/compute_resources_vms/form/_ovirt.html.erb 2013-03-08 18:14:34.524000076 -0500 | ||
---|---|---|
7 | 7 |
:onchange => 'ovirt_clusterSelected(this);', |
8 | 8 |
:help_inline => image_tag('spinner.gif', :id => 'cluster_indicator', :class => 'hide').html_safe } %> |
9 | 9 |
<%= f.hidden_field :cluster if !new %> |
10 |
<%= select_f f, :quota, compute_resource.quotas, :id, :name, {}, |
|
11 |
{ :help_inline => image_tag('spinner.gif', :id => 'quota_indicator', :class => 'hide').html_safe, |
|
12 |
:help_block => "Quota to use"} %> |
|
13 |
<%= f.hidden_field :quota if !new %> |
|
10 | 14 |
<%= select_f f, :template, compute_resource.hardware_profiles, :id, :name, {}, |
11 | 15 |
{ :disabled => !new, :'data-url' => hardware_profile_selected_compute_resource_path(compute_resource), |
12 | 16 |
:onchange => 'ovirt_hwpSelected(this);', |
foreman/lib/foreman/model/ovirt.rb 2013-03-08 11:10:07.290000100 -0500 | ||
---|---|---|
31 | 31 |
16*1024*1024*1024 |
32 | 32 |
end |
33 | 33 | |
34 |
def quotas |
|
35 |
client.quotas |
|
36 |
end |
|
37 |
|
|
38 |
def quota(id) |
|
39 |
client.quota.get(id) || raise(ActiveRecord::RecordNotFound) |
|
40 |
end |
|
41 | ||
34 | 42 |
def hardware_profiles(opts={}) |
35 | 43 |
client.templates |
36 | 44 |
end |