Revision 40df7dfb
Added by Daniel Lobato Garcia about 11 years ago
- ID 40df7dfbfcde38f06d133fea97f0d30904155916
app/models/nic/bmc.rb | ||
---|---|---|
self.attrs[method] = value
|
||
end
|
||
end
|
||
|
||
def proxy
|
||
# try to find a bmc proxy in the same subnet as our bmc device
|
||
proxy = SmartProxy.bmc_proxies.joins(:subnets).where(['dhcp_id = ? or tftp_id = ?', subnet_id, subnet_id]).first if subnet_id
|
||
proxy ||= SmartProxy.bmc_proxies.first
|
||
raise Foreman::Exception.new(N_('Unable to find a proxy with BMC feature')) if proxy.nil?
|
||
ProxyAPI::BMC.new({ :host_ip => ip,
|
||
:url => proxy.url,
|
||
:user => username,
|
||
:password => password })
|
||
end
|
||
|
||
end
|
||
end
|
Also available in: Unified diff
fixes #426 expose BMC information in foreman UI
Signed-off-by: Ohad Levy <ohadlevy@gmail.com>
This patch also adds an abstracted power management class for both VM
and BM