summaryrefslogtreecommitdiff
path: root/lib/chef
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2020-01-31 13:54:10 -0800
committerLamont Granquist <lamont@scriptkiddie.org>2020-01-31 13:54:10 -0800
commit9ce4eb455526074cc88f398a8397e5d2a62443fa (patch)
tree2e4b38b643411065340068b2b6b8d34f69f46719 /lib/chef
parent3023717497cb5540190c1977d578599437325330 (diff)
downloadchef-9ce4eb455526074cc88f398a8397e5d2a62443fa.tar.gz
Add chef-sugar virtualization helpers
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'lib/chef')
-rw-r--r--lib/chef/node/attribute.rb4
-rw-r--r--lib/chef/node/common_api.rb4
2 files changed, 6 insertions, 2 deletions
diff --git a/lib/chef/node/attribute.rb b/lib/chef/node/attribute.rb
index d872e53d9b..4ccf04af6a 100644
--- a/lib/chef/node/attribute.rb
+++ b/lib/chef/node/attribute.rb
@@ -1,7 +1,7 @@
#--
# Author:: Adam Jacob (<adam@chef.io>)
# Author:: AJ Christensen (<aj@chef.io>)
-# Copyright:: Copyright 2008-2019, Chef Software Inc.
+# Copyright:: Copyright 2008-2020, Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -453,6 +453,8 @@ class Chef
merged_attributes.read(*path)
end
+ alias :dig :read
+
def read!(*path)
merged_attributes.read!(*path)
end
diff --git a/lib/chef/node/common_api.rb b/lib/chef/node/common_api.rb
index 388b2b5e23..829552d80c 100644
--- a/lib/chef/node/common_api.rb
+++ b/lib/chef/node/common_api.rb
@@ -1,5 +1,5 @@
#--
-# Copyright:: Copyright 2016, Chef Software, Inc.
+# Copyright:: Copyright 2016-2020, Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -98,6 +98,8 @@ class Chef
nil
end
+ alias :dig :read
+
# non-autovivifying reader that throws an exception if the attribute does not exist
def read!(*path)
raise Chef::Exceptions::NoSuchAttribute.new(path.join ".") unless exist?(*path)