methods/ai_client.rb
# Import AI manifest
# This is done to change the default manifest so that it doesn't point
# to the Oracle one amongst other things
# Check the structs for settings and more information
Import AI manifest
This is done to change the default manifest so that it doesn't point
to the Oracle one amongst other things
Check the structs for settings and more information
Import AI manifest This is done to change the default manifest so that it doesn ' t point to the Oracle one amongst other things Check the structs for settings and more information
def import_ai_manifest(output_file, options)
  date_string = get_date_string(options)
  arch_list   = []
  base_name   = get_service_base_name(options)
  if !options['service'].to_s.match(/i386|sparc/) && !options['arch'].to_s.match(/i386|sparc/)
    arch_list = ['i386","SPARC']
  else
    if options['service'].to_s.match(/i386/)
      arch_list.push("i386")
    else
      if options['service'].to_s.match(/sparc/)
        arch_list.push("SPARC")
      end
    end
  end
  arch_list.each do |sys_arch|
    lc_arch = sys_arch.downcase
    backup  = options['workdir'].to_s+"/"+base_name+"_"+lc_arch+"_orig_default.xml."+date_string
    message = "Information:\tArchiving service configuration for "+base_name+"_"+lc_arch+" to "+backup
    command = "installadm export -n #{base_name}_#{lc_arch} -m orig_default > #{backup}"
    output  = execute_command(options,message,command)
    message = "Information:\tValidating service configuration "+output_file
    command = "AIM_MANIFEST=#{output_file} ; export AIM_MANIFEST ; aimanifest validate"
    output  = execute_command(options,message,command)
    if output.match(/[a-z,A-Z,0-9]/)
      handle_output(options,"AI manifest file #{output_file} does not contain a valid XML manifest")
      handle_output(options,output)
    else
      message = "Information:\tImporting "+output_file+" to service "+options['service'].to_s+" as manifest named "+options['manifest'].to_s
      command = "installadm create-manifest -n #{base_name}_#{lc_arch} -m #{options['manifest'].to_s} -f #{output_file}"
      output  = execute_command(options,message,command)
      message = "Information:\tSetting default manifest for service "+options['service'].to_s+" to "+options['manifest'].to_s
      command = "installadm set-service -o default-manifest=#{options['manifest'].to_s} #{base_name}_#{lc_arch}"
      output  = execute_command(options,message,command)
    end
  end
  return
end
def import_ai_manifest ( output_file , options ) date_string = get_date_string ( options ) arch_list = [ ] base_name = get_service_base_name ( options ) if ! options [ 'service' ] . to_s . match ( / i386|sparc / ) && ! options [ 'arch' ] . to_s . match ( / i386|sparc / ) arch_list = [ 'i386","SPARC' ] else if options [ 'service' ] . to_s . match ( / i386 / ) arch_list . push ( "i386" ) else if options [ 'service' ] . to_s . match ( / sparc / ) arch_list . push ( "SPARC" ) end end end arch_list . each do | sys_arch | lc_arch = sys_arch . downcase backup = options [ 'workdir' ] . to_s + "/" + base_name + "_" + lc_arch + "_orig_default.xml." + date_string message = "Information:\tArchiving service configuration for " + base_name + "_" + lc_arch + " to " + backup command = "installadm export -n #{base_name}_#{lc_arch} -m orig_default > #{backup}" output = execute_command ( options , message , command ) message = "Information:\tValidating service configuration " + output_file command = "AIM_MANIFEST=#{output_file} ; export AIM_MANIFEST ; aimanifest validate" output = execute_command ( options , message , command ) if output . match ( / [a-z,A-Z,0-9] / ) handle_output ( options , "AI manifest file #{output_file} does not contain a valid XML manifest" ) handle_output ( options , output ) else message = "Information:\tImporting " + output_file + " to service " + options [ 'service' ] . to_s + " as manifest named " + options [ 'manifest' ] . to_s command = "installadm create-manifest -n #{base_name}_#{lc_arch} -m #{options['manifest'].to_s} -f #{output_file}" output = execute_command ( options , message , command ) message = "Information:\tSetting default manifest for service " + options [ 'service' ] . to_s + " to " + options [ 'manifest' ] . to_s command = "installadm set-service -o default-manifest=#{options['manifest'].to_s} #{base_name}_#{lc_arch}" output = execute_command ( options , message , command ) end end return end
Import AI manifest
This is done to change the default manifest so that it doesn't point
to the Oracle one amongst other things
Check the structs for settings and more information
Import AI manifest This is done to change the default manifest so that it doesn ' t point to the Oracle one amongst other things Check the structs for settings and more information
output_file
<not_specific>
options
<not_specific>