[icinga-checkins] icinga.org: chef-icinga2/master: ran rubocop

git at icinga.org git at icinga.org
Sun Nov 13 07:53:40 CET 2016


Module: chef-icinga2
Branch: master
Commit: b83447c2433cc51a5caa269e13513c7e2ead3a7a
URL:    https://git.icinga.org/?p=chef-icinga2.git;a=commit;h=b83447c2433cc51a5caa269e13513c7e2ead3a7a

Author: JJ Asghar <jj at chef.io>
Date:   Tue Oct 11 14:39:26 2016 +0100

ran rubocop

---

 libraries/search.rb |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libraries/search.rb b/libraries/search.rb
index e8e84f4..97d8fa1 100644
--- a/libraries/search.rb
+++ b/libraries/search.rb
@@ -206,8 +206,8 @@ module Icinga2
       node_hash['chef_environment'] = node.chef_environment
       node_hash['environment'] = node.chef_environment
       node_hash['run_list'] = node.run_list
-      node_hash['recipes'] = !node.run_list.nil? ? node.run_list.recipes : []
-      node_hash['roles'] = !node.run_list.nil? ? node.run_list.roles : []
+      node_hash['recipes'] = !node.run_list.nil? ? node.run_list&.recipes
+      node_hash['roles'] = !node.run_list.nil? ? node.run_list&.roles
       node_hash['fqdn'] = node['fqdn']
       node_hash['hostname'] = node['hostname']
       node_hash['kernel_machine'] = !node['kernel'].nil? ? node['kernel']['machine'] : nil
@@ -299,7 +299,7 @@ module Icinga2
     def node_custom_vars(vars)
       custom_vars = {}
       # add icinga2 host custom vars from node custom_vars
-      if vars && vars.key?('client')
+      if vars&.key?('client')
         if vars['client'].key?('custom_vars') && vars['client']['custom_vars'].is_a?(Hash)
           custom_vars = vars['client']['custom_vars'].to_hash
         end



More information about the icinga-checkins mailing list