lib/core/core_setup_init.rb
# Internal function to verify if any attributes adds an object dependency
#
Internal function to verify if any attributes adds an object dependency
Internal function to verify if any attributes adds an object dependency
def _setup_bs_objs_new_dep(dependencies, parent_attr_name, element)
      attrs = (element[:attrs] + element[:group][:attrs]).uniq
      return if attrs.length == 0
      found = false
      attrs.each do |attr_name|
        obj_found = dependencies.rh_get(:attributes, attr_name, :obj)
        next if obj_found.nil?
        objs = element.rh_get(:group, :objs)
        next if objs.include?(obj_found)
        dep = dependencies.rh_get(:attributes, attr_name)
        objs << obj_found
        objs = (objs + dep[:group][:objs]).uniq
        element.rh_set(objs, :group, :objs)
        attrs = element.rh_get(:group, :attrs)
        attrs_found = (attrs + dep[:attrs] + dep[:group][:attrs]).uniq
        element.rh_set(attrs_found, :group, :attrs)
        Lorj.debug(4, "attr setup '%s': '%s' dependent attribute adds a new"\
                      " object dependency '%s'",
                   parent_attr_name, attr_name, obj_found)
        found = true
      end
      return unless found
      Lorj.debug(5, "attr setup '%s': query '%s' (+ %s) and "\
                    "requires '%s' (+ %s)", parent_attr_name,
                 element[:obj], element[:group][:objs],
                 element[:attrs], element[:group][:attrs] - element[:attrs])
    end
def _setup_bs_objs_new_dep ( dependencies , parent_attr_name , element ) attrs = ( element [ :attrs ] + element [ :group ] [ :attrs ] ) . uniq return if attrs . length == 0 found = false attrs . each do | attr_name | obj_found = dependencies . rh_get ( :attributes , attr_name , :obj ) next if obj_found . nil? objs = element . rh_get ( :group , :objs ) next if objs . include? ( obj_found ) dep = dependencies . rh_get ( :attributes , attr_name ) objs << obj_found objs = ( objs + dep [ :group ] [ :objs ] ) . uniq element . rh_set ( objs , :group , :objs ) attrs = element . rh_get ( :group , :attrs ) attrs_found = ( attrs + dep [ :attrs ] + dep [ :group ] [ :attrs ] ) . uniq element . rh_set ( attrs_found , :group , :attrs ) Lorj . debug ( 4 , "attr setup '%s': '%s' dependent attribute adds a new" " object dependency '%s'" , parent_attr_name , attr_name , obj_found ) found = true end return unless found Lorj . debug ( 5 , "attr setup '%s': query '%s' (+ %s) and " "requires '%s' (+ %s)" , parent_attr_name , element [ :obj ] , element [ :group ] [ :objs ] , element [ :attrs ] , element [ :group ] [ :attrs ] - element [ :attrs ] ) end
Internal function to verify if any attributes adds an object dependency
Internal function to verify if any attributes adds an object dependency
# Updating list of deps objs # Undating list of deps attributes
dependencies
<not_specific>
parent_attr_name
<not_specific>
element
<not_specific>