Sha256: 9720f1b3ccf7dcb1eca5584df96654a9d71c47624b95ab636aed34015e52530a

Contents?: true

Size: 1.24 KB

Versions: 66

Compression:

Stored size: 1.24 KB

Contents

module VmScanItemFile
  def to_xml
    xml = @xml_class.newNode("scan_item")
    xml.add_attributes("guid" => @params["guid"], "name" => @params["name"], "item_type" => @params["item_type"])

    scan_definition['stats'].each do |d|
      if d["data"]
        xml_partial = xml.root.add_element("filesystem")
        xml_partial.add_attributes(d["data"].root.attributes)
        xml_partial.add_attribute("id", d["target"])
        e = d["data"].root.elements[1]
        until e.blank?
          xml_partial << e
          e = d["data"].root.elements[1]
        end
      end
    end

    xml
  end

  def parse_data(vm, data, &_blk)
    if data.nil?
      st = Time.now
      $log.info "Scanning [Profile-Files] information."
      yield({:msg => 'Scanning Profile-File'}) if block_given?
      scan_definition["stats"].each do |d|
        # MD5deep scanning will raise an error if the path does not exist.
        begin
          # Skip if we already have data for this element
          options = {'contents' => d['content']}
          d["data"] = MD5deep.scan_glob(vm.rootTrees[0], d["target"], options) if d["data"].nil?
        rescue
        end
      end
      $log.info "Scanning [Profile-Files] information ran for [#{Time.now - st}] seconds."
    end
  end
end

Version data entries

66 entries across 66 versions & 1 rubygems

Version Path
manageiq-smartstate-0.10.1 lib/metadata/ScanProfile/modules/VmScanItemFile.rb
manageiq-smartstate-0.10.0 lib/metadata/ScanProfile/modules/VmScanItemFile.rb
manageiq-smartstate-0.9.0 lib/metadata/ScanProfile/modules/VmScanItemFile.rb
manageiq-smartstate-0.8.1 lib/metadata/ScanProfile/modules/VmScanItemFile.rb
manageiq-smartstate-0.8.0 lib/metadata/ScanProfile/modules/VmScanItemFile.rb
manageiq-smartstate-0.7.0 lib/metadata/ScanProfile/modules/VmScanItemFile.rb
manageiq-smartstate-0.6.2 lib/metadata/ScanProfile/modules/VmScanItemFile.rb
manageiq-smartstate-0.5.10 lib/metadata/ScanProfile/modules/VmScanItemFile.rb
manageiq-smartstate-0.3.10 lib/metadata/ScanProfile/modules/VmScanItemFile.rb
manageiq-smartstate-0.6.1 lib/metadata/ScanProfile/modules/VmScanItemFile.rb
manageiq-smartstate-0.3.9 lib/metadata/ScanProfile/modules/VmScanItemFile.rb
manageiq-smartstate-0.6.0 lib/metadata/ScanProfile/modules/VmScanItemFile.rb
manageiq-smartstate-0.5.9 lib/metadata/ScanProfile/modules/VmScanItemFile.rb
manageiq-smartstate-0.5.8 lib/metadata/ScanProfile/modules/VmScanItemFile.rb
manageiq-smartstate-0.3.8 lib/metadata/ScanProfile/modules/VmScanItemFile.rb
manageiq-smartstate-0.5.7 lib/metadata/ScanProfile/modules/VmScanItemFile.rb
manageiq-smartstate-0.3.7 lib/metadata/ScanProfile/modules/VmScanItemFile.rb
manageiq-smartstate-0.5.6 lib/metadata/ScanProfile/modules/VmScanItemFile.rb
manageiq-smartstate-0.3.6 lib/metadata/ScanProfile/modules/VmScanItemFile.rb
manageiq-smartstate-0.5.5 lib/metadata/ScanProfile/modules/VmScanItemFile.rb