文件操作 - hyper_v.rb
返回文件管理
返回主菜单
删除本文件
文件: /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/facter/facts/linux/hypervisors/hyper_v.rb
编辑文件内容
# frozen_string_literal: true module Facts module Linux module Hypervisors class HyperV FACT_NAME = 'hypervisors.hyperv' def call_the_resolver fact_value = check_hyper_v Facter::ResolvedFact.new(FACT_NAME, fact_value) end def check_hyper_v manufacturer = Facter::Resolvers::Linux::DmiBios.resolve(:sys_vendor) product_name = Facter::Resolvers::Linux::DmiBios.resolve(:product_name) return {} if manufacturer =~ /Microsoft/ || product_name == 'Virtual Machine' nil end end end end end
修改文件时间
将文件时间修改为当前时间的前一年
删除文件