libraries/patch_mgmt.rb
def suma_params(niminfo, desc, oslevel, location, targets)
      params = {}

      # build list of targets
      target_list = expand_targets(targets, niminfo['nim']['clients'].keys)
      log_debug("target_list=#{target_list}")

      params['DisplayName'] = desc

      # compute suma request type based on oslevel property
      rq_type = compute_rq_type(oslevel)
      log_debug("rq_type=#{rq_type}")
      params['RqType'] = rq_type

      # compute suma request name based on metadata info
      rq_name = compute_rq_name(rq_type, target_list, niminfo)
      log_debug("rq_name=#{rq_name}")
      params['RqName'] = rq_name

      # metadata does not match any fixes
      return nil if params['RqName'].nil? || params['RqName'].empty?

      # compute suma filter ml based on targets property
      filter_ml = compute_filter_ml(target_list, rq_name, niminfo)
      log_debug("filter_ml=#{filter_ml}")
      params['FilterML'] = filter_ml

      # check ml level of machines against expected oslevel
      # case rq_type
      # when 'SP', 'TL'
      #   if filter_ml[0..3].to_i < oslevel.match(/^([0-9]{4})-[0-9]{2}(|-[0-9]{2}|-[0-9]{2}-[0-9]{4})$/)[1].to_i
      #     raise InvalidOsLevelProperty, 'Error: cannot upgrade machines to a new release using suma'
      #   end
      # end

      # compute lpp source name based on request name
      lpp_source = compute_lpp_source_name(location, rq_name)
      log_debug("lpp_source=#{lpp_source}")
      params['LppSource'] = lpp_source

      # compute suma dl target based on lpp source name
      dl_target = compute_dl_target(location, lpp_source, niminfo)
      log_debug("dl_target=#{dl_target}")
      params['DLTarget'] = dl_target

      params
    end
# -----------------------------------------------------------------
# returns a hash with all suma params
#
# -----------------------------------------------------------------
returns a hash with all suma params
returns a hash with all suma params
def suma_params(niminfo, desc, oslevel, location, targets)
      params = {}
      target_list = expand_targets(targets, niminfo['nim']['clients'].keys)
      log_debug("target_list=#{target_list}")
      params['DisplayName'] = desc
      rq_type = compute_rq_type(oslevel)
      log_debug("rq_type=#{rq_type}")
      params['RqType'] = rq_type
      rq_name = compute_rq_name(rq_type, target_list, niminfo)
      log_debug("rq_name=#{rq_name}")
      params['RqName'] = rq_name
      return nil if params['RqName'].nil? || params['RqName'].empty?
      filter_ml = compute_filter_ml(target_list, rq_name, niminfo)
      log_debug("filter_ml=#{filter_ml}")
      params['FilterML'] = filter_ml
      lpp_source = compute_lpp_source_name(location, rq_name)
      log_debug("lpp_source=#{lpp_source}")
      params['LppSource'] = lpp_source
      dl_target = compute_dl_target(location, lpp_source, niminfo)
      log_debug("dl_target=#{dl_target}")
      params['DLTarget'] = dl_target
      params
    end
def suma_params ( niminfo , desc , oslevel , location , targets ) params = { } target_list = expand_targets ( targets , niminfo [ 'nim' ] [ 'clients' ] . keys ) log_debug ( "target_list=#{target_list}" ) params [ 'DisplayName' ] = desc rq_type = compute_rq_type ( oslevel ) log_debug ( "rq_type=#{rq_type}" ) params [ 'RqType' ] = rq_type rq_name = compute_rq_name ( rq_type , target_list , niminfo ) log_debug ( "rq_name=#{rq_name}" ) params [ 'RqName' ] = rq_name return nil if params [ 'RqName' ] . nil? || params [ 'RqName' ] . empty? filter_ml = compute_filter_ml ( target_list , rq_name , niminfo ) log_debug ( "filter_ml=#{filter_ml}" ) params [ 'FilterML' ] = filter_ml lpp_source = compute_lpp_source_name ( location , rq_name ) log_debug ( "lpp_source=#{lpp_source}" ) params [ 'LppSource' ] = lpp_source dl_target = compute_dl_target ( location , lpp_source , niminfo ) log_debug ( "dl_target=#{dl_target}" ) params [ 'DLTarget' ] = dl_target params end
returns a hash with all suma params
returns a hash with all suma params
# build list of targets # compute suma request type based on oslevel property # compute suma request name based on metadata info # metadata does not match any fixes # compute suma filter ml based on targets property # check ml level of machines against expected oslevel # case rq_type # when 'SP', 'TL' #   if filter_ml[0..3].to_i < oslevel.match(/^([0-9]{4})-[0-9]{2}(|-[0-9]{2}|-[0-9]{2}-[0-9]{4})$/)[1].to_i #     raise InvalidOsLevelProperty, 'Error: cannot upgrade machines to a new release using suma' #   end # end # compute lpp source name based on request name # compute suma dl target based on lpp source name
niminfo
desc
oslevel
location
targets