diff options
author | Serdar Sutay <serdar@opscode.com> | 2014-08-13 11:56:59 -0700 |
---|---|---|
committer | Serdar Sutay <serdar@opscode.com> | 2014-08-13 11:57:08 -0700 |
commit | 8d3dfdc77591b8f35ca92a94046ff629ac1f23fb (patch) | |
tree | a1b48fe35f66bd99d033e325e168af834b29a535 /spec/support/lib | |
parent | 6ad12bac9cd0b736915dcafe9232d168bc1e0dc6 (diff) | |
download | chef-8d3dfdc77591b8f35ca92a94046ff629ac1f23fb.tar.gz |
Make sure freebsd_package is captured with the resource name it's declared with in resource collection.
Diffstat (limited to 'spec/support/lib')
-rw-r--r-- | spec/support/lib/chef/resource/zen_follower.rb | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/spec/support/lib/chef/resource/zen_follower.rb b/spec/support/lib/chef/resource/zen_follower.rb new file mode 100644 index 0000000000..0fa0c4af5b --- /dev/null +++ b/spec/support/lib/chef/resource/zen_follower.rb @@ -0,0 +1,46 @@ +# +# Copyright:: Copyright (c) 2014 Chef Software, Inc. +# License:: Apache License, Version 2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'chef/knife' +require 'chef/json_compat' + +class Chef + class Resource + class ZenFollower < Chef::Resource + attr_accessor :created_as_type + + provides :follower, :on_platforms => ["zen"] + + def initialize(name, run_context=nil) + @resource_name = :zen_follower + @created_as_type = "zen_follower" + super + end + + def to_s + "#{created_as_type}[#{name}]" + end + + def master(arg=nil) + if !arg.nil? + @master = arg + end + @master + end + end + end +end |