core/rails/app/models/barclamp_bios/dellrseries.rb
# The WSMAN namespaces we are going to get and set our BIOS configs from.
The WSMAN namespaces we are going to get and set our BIOS configs from.
The WSMAN namespaces we are going to get and set our BIOS configs from .
def commit
    to_commit = @settings.values.reject{|s|s.current_value == s.proposed_value || s.proposed_value.nil?}
    return false if to_commit.empty?
    @client.invoke("http://schemas.dell.com/wbem/wscim/1/cim-schema/2/DCIM_JobService","DeleteJobQueue",{"JobID" => "JID_CLEARALL"})
    @client.invoke("http://schemas.dell.com/wbem/wscim/1/cim-schema/2/DCIM_BIOSService","DeletePendingConfiguration",{"Target" => "BIOS.Setup.1-1"})
    args = {
      "Target" => "BIOS.Setup.1-1",
      "AttributeName" => [],
      "AttributeValue" => []
    }
    to_commit.each do |setting|
      args["AttributeName"] << setting.name
      args["AttributeValue"] << setting.proposed_value
    end
    res = @client.invoke("http://schemas.dell.com/wbem/wscim/1/cim-schema/2/DCIM_BIOSService","SetAttributes",args)
    raise("Could not set BIOS settings!\n#{res.to_xml}") if res.ReturnValue.text != "0"
    res = @client.invoke("http://schemas.dell.com/wbem/wscim/1/cim-schema/2/DCIM_BIOSService",
                         "CreateTargetedConfigJob",
                         { "Target" => "BIOS.Setup.1-1",
                           "RebootJobType" => "3",
                           "scheduledStartTime" => "TIME_NOW"})
    raise("Unable to commit BIOS settings!\n#{res.to_xml}") if res.ReturnValue.text != "4096"
    true
  end
def commit to_commit = @settings . values . reject { | s | s . current_value == s . proposed_value || s . proposed_value . nil? } return false if to_commit . empty? @client . invoke ( "http://schemas.dell.com/wbem/wscim/1/cim-schema/2/DCIM_JobService" , "DeleteJobQueue" , { "JobID" => "JID_CLEARALL" } ) @client . invoke ( "http://schemas.dell.com/wbem/wscim/1/cim-schema/2/DCIM_BIOSService" , "DeletePendingConfiguration" , { "Target" => "BIOS.Setup.1-1" } ) args = { "Target" => "BIOS.Setup.1-1" , "AttributeName" => [ ] , "AttributeValue" => [ ] } to_commit . each do | setting | args [ "AttributeName" ] << setting . name args [ "AttributeValue" ] << setting . proposed_value end res = @client . invoke ( "http://schemas.dell.com/wbem/wscim/1/cim-schema/2/DCIM_BIOSService" , "SetAttributes" , args ) raise ( "Could not set BIOS settings!\n#{res.to_xml}" ) if res . ReturnValue . text != "0" res = @client . invoke ( "http://schemas.dell.com/wbem/wscim/1/cim-schema/2/DCIM_BIOSService" , "CreateTargetedConfigJob" , { "Target" => "BIOS.Setup.1-1" , "RebootJobType" => "3" , "scheduledStartTime" => "TIME_NOW" } ) raise ( "Unable to commit BIOS settings!\n#{res.to_xml}" ) if res . ReturnValue . text != "4096" true end
The WSMAN namespaces we are going to get and set our BIOS configs from.
The WSMAN namespaces we are going to get and set our BIOS configs from .
# Gather all the changed settings. # Clear any pending config job. # We do not care about the results. # Propose the changes via WSMAN # Now, create a targeted config job to apply the proposed changes # Arguably, we will need to be more intelligent than this once we start handling # non-BIOS settings, but this does the job for now.