diff options
author | Tim Smith <tsmith@chef.io> | 2018-09-21 15:04:09 -0700 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2019-03-11 12:20:20 -0700 |
commit | df23dbbda7d4eb621804f004ff85181d83a11641 (patch) | |
tree | dc4ac3d354e5b9eb3229ed9be56d5447cc9a1d85 /lib/chef/dsl | |
parent | b870d8c578a6424e405ec2083d5f47d331f09d14 (diff) | |
download | chef-df23dbbda7d4eb621804f004ff85181d83a11641.tar.gz |
WIP: Remove audit mode from chef-client
This just gives us a line count to the change and perhaps a starting
point for when we do this in Chef 15
Signed-off-by: Tim Smith <tsmith@chef.io>
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'lib/chef/dsl')
-rw-r--r-- | lib/chef/dsl/audit.rb | 51 | ||||
-rw-r--r-- | lib/chef/dsl/recipe.rb | 2 |
2 files changed, 0 insertions, 53 deletions
diff --git a/lib/chef/dsl/audit.rb b/lib/chef/dsl/audit.rb deleted file mode 100644 index 927523e976..0000000000 --- a/lib/chef/dsl/audit.rb +++ /dev/null @@ -1,51 +0,0 @@ -# -# Author:: Tyler Ball (<tball@chef.io>) -# Copyright:: Copyright 2014-2016, 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/exceptions" - -class Chef - module DSL - module Audit - - # Can encompass tests in a `control` block or `describe` block - # Adds the controls group and block (containing controls to execute) to the runner's list of pending examples - def control_group(*args, &block) - raise Chef::Exceptions::NoAuditsProvided unless block - - name = args[0] - if name.nil? || name.empty? - raise Chef::Exceptions::AuditNameMissing - elsif run_context.audits.key?(name) - raise Chef::Exceptions::AuditControlGroupDuplicate.new(name) - end - - # This DSL will only work in the Recipe class because that exposes the cookbook_name - cookbook_name = self.cookbook_name - metadata = { - cookbook_name: cookbook_name, - cookbook_version: run_context.cookbook_collection[cookbook_name].version, - recipe_name: recipe_name, - line_number: block.source_location[1], - } - - run_context.audits[name] = Struct.new(:args, :block, :metadata).new(args, block, metadata) - end - - end - end -end diff --git a/lib/chef/dsl/recipe.rb b/lib/chef/dsl/recipe.rb index 9da812cec0..4d68a36a81 100644 --- a/lib/chef/dsl/recipe.rb +++ b/lib/chef/dsl/recipe.rb @@ -24,7 +24,6 @@ require "chef/dsl/data_query" require "chef/dsl/include_recipe" require "chef/dsl/registry_helper" require "chef/dsl/reboot_pending" -require "chef/dsl/audit" require "chef/dsl/powershell" require "chef/dsl/core" require "chef/mixin/lazy_module_include" @@ -55,7 +54,6 @@ class Chef include Chef::DSL::IncludeRecipe include Chef::DSL::RegistryHelper include Chef::DSL::RebootPending - include Chef::DSL::Audit include Chef::DSL::Powershell include Chef::DSL::Resources include Chef::DSL::Definitions |