Fix rubocop and foodcritic complaints
authorTom Hughes <tom@compton.nu>
Mon, 30 May 2016 09:10:41 +0000 (10:10 +0100)
committerTom Hughes <tom@compton.nu>
Mon, 30 May 2016 09:10:41 +0000 (10:10 +0100)
cookbooks/imagery/recipes/gb_os_sv.rb
cookbooks/nginx/recipes/default.rb

index 7711fd2acca502763f2f36a8281698c9aeacf92d..fd91853297d78324b89302d599dfc01f81306a78 100644 (file)
@@ -166,5 +166,5 @@ imagery_layer "gb_os_sv_2016_04" do
   copyright "Contains Ordnance Survey data © Crown copyright and database right 2015"
   background_colour "230 246 255" # OSSV Water Blue
   extension "os_sv_png"
-  url_aliases [ "/sv-2016-04", "/sv" ] # Add "/sv" to current edition for backward compatibility
+  url_aliases ["/sv-2016-04", "/sv"] # Add "/sv" to current edition for backward compatibility
 end
index 54a9b7524b0953096754921167cdd845115f7352..bd104f676f11a16f6ad34d501231339e15c2f76f 100644 (file)
@@ -28,20 +28,18 @@ template "/etc/nginx/nginx.conf" do
   mode 0644
 end
 
-if node['nginx']['cache']['fastcgi']['enable']
-  directory "/var/cache/nginx/fastcgi-cache" do
-    owner "www-data"
-    group "root"
-    mode 0755
-  end
+directory "/var/cache/nginx/fastcgi-cache" do
+  owner "www-data"
+  group "root"
+  mode 0755
+  only_if { node[:nginx][:cache][:fastcgi][:enable] }
 end
 
-if node['nginx']['cache']['proxy']['enable']
-  directory "/var/cache/nginx/proxy-cache" do
-    owner "www-data"
-    group "root"
-    mode 0755
-  end
+directory "/var/cache/nginx/proxy-cache" do
+  owner "www-data"
+  group "root"
+  mode 0755
+  only_if { node[:nginx][:cache][:proxy][:enable] }
 end
 
 service "nginx" do