]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-cookbooks.git/commitdiff
Resolve rubocop warnings
authorTim Smith <tsmith84@gmail.com>
Tue, 15 Sep 2015 22:18:18 +0000 (15:18 -0700)
committerTim Smith <tsmith84@gmail.com>
Tue, 15 Sep 2015 22:18:18 +0000 (15:18 -0700)
attributes/cephfs.rb
libraries/default.rb
providers/client.rb
providers/pool.rb
recipes/osd.rb
recipes/radosgw_apache2_repo.rb

index 7c631174abf5f7b5b55163665a7e25506ad63d51..0ca75f8fefd1721a07c9c4b7351879951cee6b5d 100644 (file)
@@ -1,5 +1,5 @@
 default['ceph']['cephfs_mount'] = '/ceph'
-default['ceph']['cephfs_use_fuse'] = nil  # whether the recipe's fuse mount uses cephfs-fuse instead of kernel client, defaults to heuristics
+default['ceph']['cephfs_use_fuse'] = nil # whether the recipe's fuse mount uses cephfs-fuse instead of kernel client, defaults to heuristics
 
 case node['platform_family']
 when 'debian'
index 44a47e1a13e136a10da0d2bbca0c1924f06cb281..297da3753734b3a77f78fe925c845b9d32d2b98e 100644 (file)
@@ -19,7 +19,6 @@ def mon_env_search_string
     elsif node['ceph']['search_environment']
       # search for any nodes with this environment
       search_string += " AND chef_environment:#{node.chef_environment}"
-    else
       # search for any mon nodes
     end
   end
@@ -121,7 +120,7 @@ def mon_addresses
       end
     end
   end
-  mon_ips.reject { |m| m.nil? }.uniq
+  mon_ips.reject(&:nil?).uniq
 end
 
 def mon_secret
index 87312218522d358c7c64dc64ecff8fefd1a9ed79..548b76b21910d55600b620ebb821b0002ad48e09 100644 (file)
@@ -14,17 +14,17 @@ action :add do
 
   if @current_resource.exists
     if @current_resource.keys_match && @current_resource.caps_match
-      Chef::Log.info "Client #{ @new_resource } already exists and matches "\
+      Chef::Log.info "Client #{@new_resource} already exists and matches "\
                      'specifications - nothing to do.'
     else
-      converge_by("Recreating client #{ @new_resource } as existing doesn't "\
+      converge_by("Recreating client #{@new_resource} as existing doesn't "\
                   'match specifications') do
         delete_entity(keyname)
         create_entity(keyname)
       end
     end
   else
-    converge_by("Creating client #{ @new_resource }") do
+    converge_by("Creating client #{@new_resource}") do
       create_entity(keyname)
     end
   end
@@ -40,7 +40,6 @@ action :add do
     mode mode
     sensitive true if Chef::Resource::File.method_defined? :sensitive
   end
-
 end
 
 def load_current_resource
index 2c2b0b0b7715a7d85af955873b85ea4eb5fcc702..182c45012a53e540be61497bdad27b38e79f76d4 100644 (file)
@@ -13,9 +13,9 @@ use_inline_resources
 
 action :create do
   if @current_resource.exists
-    Chef::Log.info "#{ @new_resource } already exists - nothing to do."
+    Chef::Log.info "#{@new_resource} already exists - nothing to do."
   else
-    converge_by("Creating #{ @new_resource }") do
+    converge_by("Creating #{@new_resource}") do
       create_pool
     end
   end
@@ -23,11 +23,11 @@ end
 
 action :delete do
   if @current_resource.exists
-    converge_by("Deleting #{ @new_resource }") do
+    converge_by("Deleting #{@new_resource}") do
       delete_pool
     end
   else
-    Chef::Log.info "#{ @current_resource } does not exist - nothing to do."
+    Chef::Log.info "#{@current_resource} does not exist - nothing to do."
   end
 end
 
@@ -43,7 +43,7 @@ def create_pool
   cmd = Mixlib::ShellOut.new(cmd_text)
   cmd.run_command
   cmd.error!
-  Chef::Log.debug "Pool created: #{ cmd.stderr }"
+  Chef::Log.debug "Pool created: #{cmd.stderr}"
 end
 
 def delete_pool
@@ -53,16 +53,16 @@ def delete_pool
   cmd = Mixlib::ShellOut.new(cmd_text)
   cmd.run_command
   cmd.error!
-  Chef::Log.debug "Pool deleted: #{ cmd.stderr }"
+  Chef::Log.debug "Pool deleted: #{cmd.stderr}"
 end
 
 def pool_exists?(name)
   cmd = Mixlib::ShellOut.new("ceph osd pool get #{name} size")
   cmd.run_command
   cmd.error!
-  Chef::Log.debug "Pool exists: #{ cmd.stdout }"
+  Chef::Log.debug "Pool exists: #{cmd.stdout}"
   true
 rescue
-  Chef::Log.debug "Pool doesn't seem to exist: #{ cmd.stderr }"
+  Chef::Log.debug "Pool doesn't seem to exist: #{cmd.stderr}"
   false
 end
index 8cf410030dbe6cbce64ed0746eb6c6f3f9506394..d07f16112a795ef543f491d99e2e6540230be4c4 100644 (file)
@@ -94,7 +94,7 @@ else
   if node['ceph']['osd_devices']
     devices = node['ceph']['osd_devices']
 
-    devices = Hash[(0...devices.size).zip devices] unless devices.kind_of? Hash
+    devices = Hash[(0...devices.size).zip devices] unless devices.is_a? Hash
 
     devices.each do |index, osd_device|
       unless osd_device['status'].nil?
index e34b64dc8a29cb5d9c6505bd55e85ef4d85f63bc..e58182b11683adbde33cb56b50b0aba6040dc476 100644 (file)
@@ -1,6 +1,6 @@
 if node['ceph']['radosgw']['use_apache_fork'] == true
   if node.platform_family?('debian') &&
-    %w(precise quantal raring saucy squeeze trusty wheezy).include?(node['lsb']['codename'])
+     %w(precise quantal raring saucy squeeze trusty wheezy).include?(node['lsb']['codename'])
     apt_repository 'ceph-apache2' do
       repo_name 'ceph-apache2'
       uri "http://gitbuilder.ceph.com/apache2-deb-#{node['lsb']['codename']}-x86_64-basic/ref/master"
@@ -16,7 +16,7 @@ if node['ceph']['radosgw']['use_apache_fork'] == true
       key 'https://ceph.com/git/?p=ceph.git;a=blob_plain;f=keys/autobuild.asc'
     end
   elsif (node.platform_family?('fedora') && [18, 19].include?(node['platform_version'].to_i)) ||
-    (node.platform_family?('rhel') && [6].include?(node['platform_version'].to_i))
+        (node.platform_family?('rhel') && [6].include?(node['platform_version'].to_i))
     platform_family = node['platform_family']
     platform_version = node['platform_version'].to_i
     yum_repository 'ceph-apache2' do