/usr/lib/ruby/vendor_ruby/chef_compat/resource/lwrp_base.rb is in ruby-compat-resource 12.10.5-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | require 'chef_compat/resource'
require 'chef_compat/copied_from_chef/chef/resource'
require 'chef/mixin/convert_to_class_name'
require 'chef/mixin/from_file'
module ChefCompat
class Resource < ChefCompat::CopiedFromChef::Chef::Resource
class LWRPBase < ChefCompat::Resource
class<<self
include Chef::Mixin::ConvertToClassName
include Chef::Mixin::FromFile
alias :attribute :property
# Adds +action_names+ to the list of valid actions for this resource.
# Does not include superclass's action list when appending.
def actions(*action_names)
action_names = action_names.flatten
if !action_names.empty? && !@allowed_actions
self.allowed_actions = ([ :nothing ] + action_names).uniq
else
allowed_actions(*action_names)
end
end
alias :actions= :allowed_actions=
# @deprecated
def valid_actions(*args)
Chef::Log.warn("`valid_actions' is deprecated, please use allowed_actions `instead'!")
allowed_actions(*args)
end
# Set the run context on the class. Used to provide access to the node
# during class definition.
attr_accessor :run_context
def node
run_context ? run_context.node : nil
end
end
end
end
end
|