summaryrefslogtreecommitdiff
path: root/lib/chef_zero/chef_data/default_creator.rb
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2019-12-29 18:06:37 -0800
committerGitHub <noreply@github.com>2019-12-29 18:06:37 -0800
commitc8bf6efa66ff005ab87ff81c9a857ea0c6c1090e (patch)
tree3a25409c03ff3ac83f94e6e740145353d3e2c095 /lib/chef_zero/chef_data/default_creator.rb
parent435755ee68c14fd6d6f858e451e7afeee1610e6f (diff)
parentecad8fee4a946b337e60a4274de2b2c872c9e81b (diff)
downloadchef-zero-c8bf6efa66ff005ab87ff81c9a857ea0c6c1090e.tar.gz
Merge pull request #298 from chef/chefstyle
Apply Chefstyle
Diffstat (limited to 'lib/chef_zero/chef_data/default_creator.rb')
-rw-r--r--lib/chef_zero/chef_data/default_creator.rb11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/chef_zero/chef_data/default_creator.rb b/lib/chef_zero/chef_data/default_creator.rb
index 5f6cf8b..90c8200 100644
--- a/lib/chef_zero/chef_data/default_creator.rb
+++ b/lib/chef_zero/chef_data/default_creator.rb
@@ -140,6 +140,7 @@ module ChefZero
def exists?(path)
return true if path.size == 0
+
parent_list = list(path[0..-2])
parent_list && parent_list.include?(path[-1])
end
@@ -184,7 +185,8 @@ module ChefZero
value = DEFAULT_ORG_SPINE
2.upto(path.size - 1) do |index|
value = nil if @deleted[path[0..index]]
- break if !value
+ break unless value
+
value = value[path[index]]
end
@@ -272,7 +274,8 @@ module ChefZero
object_path = AclPath.get_object_path(path)
# The actual things containers correspond to don't have to exist, as
# long as the container does
- return nil if !data_exists?(object_path)
+ return nil unless data_exists?(object_path)
+
basic_acl =
case path[3..-1].join("/")
when "root", "containers/containers", "containers/groups"
@@ -350,7 +353,7 @@ module ChefZero
if path.size == 4 && path[0] == "organizations" && path[2] == "clients"
begin
client = FFI_Yajl::Parser.parse(data.get(path))
- if !client["validator"]
+ unless client["validator"]
unknown_owners |= [ path[3] ]
end
rescue
@@ -453,7 +456,7 @@ module ChefZero
def is_dir?(path)
case path.size
when 0, 1
- return true
+ true
when 2
path[0] == "organizations" || (path[0] == "acls" && path[1] != "root")
when 3