Revision 9a9ec5b1
Added by Daniel Lobato Garcia over 8 years ago
app/models/compute_resources/foreman/model/ovirt.rb | ||
---|---|---|
|
||
alias_attribute :datacenter, :uuid
|
||
|
||
delegate :clusters, :quotas, :templates, :to => :client
|
||
|
||
def self.model_name
|
||
ComputeResource.model_name
|
||
end
|
||
... | ... | |
16*Foreman::SIZE[:giga]
|
||
end
|
||
|
||
def quotas
|
||
client.quotas
|
||
end
|
||
|
||
def ovirt_quota=(ovirt_quota_id)
|
||
self.attrs[:ovirt_quota_id] = ovirt_quota_id
|
||
end
|
||
... | ... | |
end
|
||
end
|
||
|
||
def templates(opts = {})
|
||
client.templates
|
||
end
|
||
|
||
def available_images
|
||
templates
|
||
end
|
||
... | ... | |
compute
|
||
end
|
||
|
||
def clusters
|
||
client.clusters
|
||
end
|
||
|
||
# Check if HTTPS is mandatory, since rest_client will fail with a POST
|
||
def test_https_required
|
||
RestClient.post url, {} if URI(url).scheme == 'http'
|
Also available in: Unified diff
Refs #3809 - Enable Rails delegate cop