Skip to content
This repository has been archived by the owner on Nov 23, 2017. It is now read-only.

Commit

Permalink
COOK-318 use ::File instead of File in recipes
Browse files Browse the repository at this point in the history
  • Loading branch information
jtimberman committed Jan 16, 2011
1 parent ea73a89 commit 8c7b0c5
Show file tree
Hide file tree
Showing 53 changed files with 96 additions and 97 deletions.
4 changes: 2 additions & 2 deletions activemq/metadata.json
Expand Up @@ -26,7 +26,7 @@
]
},
"license": "Apache 2.0",
"version": "0.3.2",
"version": "0.3.3",
"maintainer": "Opscode, Inc.",
"suggestions": {
},
Expand All @@ -39,4 +39,4 @@
},
"description": "Installs activemq and sets it up as a runit service",
"long_description": "= DESCRIPTION:\n\nInstalls activemq and sets up a runit service.\n\n= REQUIREMENTS:\n\nTested on Ubuntu 9.04.\n\nOpscode cookbooks:\n\n* java\n* runit\n\n= ATTRIBUTES:\n\n* activemq[:mirror] - download URL up to the apache/activemq/apache-activemq directory.\n* activemq[:version] - version to install.\n\n= USAGE:\n\nInclude the default recipe on systems where you want to run activemq. At this time the cookbook doesn't use any custom configuration for activemq.\n\n= LICENSE AND AUTHOR:\n\nAuthor:: Joshua Timberman (<joshua@opscode.com>)\n\nCopyright:: 2009, Opscode, Inc\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n"
}
}
2 changes: 1 addition & 1 deletion activemq/metadata.rb
Expand Up @@ -3,7 +3,7 @@
license "Apache 2.0"
description "Installs activemq and sets it up as a runit service"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.rdoc'))
version "0.3.2"
version "0.3.3"

recipe "activemq", "Installs ActiveMQ from source and sets it up as a runit service"

Expand Down
2 changes: 1 addition & 1 deletion activemq/recipes/default.rb
Expand Up @@ -23,7 +23,7 @@
version = node[:activemq][:version]
mirror = node[:activemq][:mirror]

unless File.exists?("/opt/apache-activemq-#{version}/bin/activemq")
unless ::File.exists?("/opt/apache-activemq-#{version}/bin/activemq")
remote_file "/tmp/apache-activemq-#{version}-bin.tar.gz" do
source "#{mirror}/apache/activemq/apache-activemq/#{version}/apache-activemq-#{version}-bin.tar.gz"
mode "0644"
Expand Down
2 changes: 1 addition & 1 deletion apache2/definitions/apache_module.rb
Expand Up @@ -37,7 +37,7 @@
execute "a2dismod #{params[:name]}" do
command "/usr/sbin/a2dismod #{params[:name]}"
notifies :restart, resources(:service => "apache2")
only_if do File.symlink?("#{node[:apache][:dir]}/mods-enabled/#{params[:name]}.load") end
only_if do ::File.symlink?("#{node[:apache][:dir]}/mods-enabled/#{params[:name]}.load") end
end
end
end
8 changes: 4 additions & 4 deletions apache2/definitions/apache_site.rb
Expand Up @@ -25,16 +25,16 @@
command "/usr/sbin/a2ensite #{params[:name]}"
notifies :restart, resources(:service => "apache2")
not_if do
File.symlink?("#{node[:apache][:dir]}/sites-enabled/#{params[:name]}") or
File.symlink?("#{node[:apache][:dir]}/sites-enabled/000-#{params[:name]}")
::File.symlink?("#{node[:apache][:dir]}/sites-enabled/#{params[:name]}") or
::File.symlink?("#{node[:apache][:dir]}/sites-enabled/000-#{params[:name]}")
end
only_if do File.exists?("#{node[:apache][:dir]}/sites-available/#{params[:name]}") end
only_if do ::File.exists?("#{node[:apache][:dir]}/sites-available/#{params[:name]}") end
end
else
execute "a2dissite #{params[:name]}" do
command "/usr/sbin/a2dissite #{params[:name]}"
notifies :restart, resources(:service => "apache2")
only_if do File.symlink?("#{node[:apache][:dir]}/sites-enabled/#{params[:name]}") end
only_if do ::File.symlink?("#{node[:apache][:dir]}/sites-enabled/#{params[:name]}") end
end
end
end
2 changes: 1 addition & 1 deletion apache2/definitions/web_app.rb
Expand Up @@ -38,7 +38,7 @@
:application_name => application_name,
:params => params
)
if File.exists?("#{node[:apache][:dir]}/sites-enabled/#{application_name}.conf")
if ::File.exists?("#{node[:apache][:dir]}/sites-enabled/#{application_name}.conf")
notifies :reload, resources(:service => "apache2"), :delayed
end
end
Expand Down
4 changes: 2 additions & 2 deletions apache2/metadata.json
Expand Up @@ -496,5 +496,5 @@
"apache2::mod_ssl": "Apache module 'ssl' with config file, adds port 443 to listen_ports",
"apache2::mod_status": "Apache module 'status' with config file"
},
"version": "0.99.1"
}
"version": "0.99.2"
}
2 changes: 1 addition & 1 deletion apache2/metadata.rb
Expand Up @@ -3,7 +3,7 @@
license "Apache 2.0"
description "Installs and configures all aspects of apache2 using Debian style symlinks with helper definitions"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.rdoc'))
version "0.99.1"
version "0.99.2"
recipe "apache2", "Main Apache configuration"
recipe "apache2::mod_alias", "Apache module 'alias' with config file"
recipe "apache2::mod_auth_basic", "Apache module 'auth_basic'"
Expand Down
4 changes: 2 additions & 2 deletions apache2/recipes/mod_auth_openid.rb
Expand Up @@ -55,9 +55,9 @@
EOH
case node[:platform]
when "arch"
not_if { File.exists?("/usr/lib/httpd/modules/mod_auth_openid.so") }
not_if { ::File.exists?("/usr/lib/httpd/modules/mod_auth_openid.so") }
else
not_if { File.exists?("/usr/lib/apache2/modules/mod_auth_openid.so") }
not_if { ::File.exists?("/usr/lib/apache2/modules/mod_auth_openid.so") }
end
end

Expand Down
4 changes: 2 additions & 2 deletions application/metadata.json
Expand Up @@ -41,7 +41,7 @@
"platforms": {
},
"name": "application",
"version": "0.8.0",
"version": "0.8.1",
"conflicting": {
},
"license": "Apache 2.0",
Expand All @@ -55,4 +55,4 @@
"application::java_webapp": "Deploys a Java web application WAR specified in a data bag with the remote_file resource",
"application::tomcat": "Sets up the deployed Java application with Tomcat as the servlet container"
}
}
}
2 changes: 1 addition & 1 deletion application/metadata.rb
Expand Up @@ -3,7 +3,7 @@
license "Apache 2.0"
description "Deploys and configures a variety of applications defined from databag 'apps'"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version "0.8.0"
version "0.8.1"
recipe "application", "Loads application databags and selects recipes to use"
recipe "application::java_webapp", "Deploys a Java web application WAR specified in a data bag with the remote_file resource"
recipe "application::passenger-nginx", "Installs Ruby Enterprise with Passenger under Nginx"
Expand Down
4 changes: 2 additions & 2 deletions application/recipes/rails.rb
Expand Up @@ -87,11 +87,11 @@
if app.has_key?("deploy_key")
ruby_block "write_key" do
block do
f = File.open("#{app['deploy_to']}/id_deploy", "w")
f = ::File.open("#{app['deploy_to']}/id_deploy", "w")
f.print(app["deploy_key"])
f.close
end
not_if do File.exists?("#{app['deploy_to']}/id_deploy"); end
not_if do ::File.exists?("#{app['deploy_to']}/id_deploy"); end
end

file "#{app['deploy_to']}/id_deploy" do
Expand Down
4 changes: 2 additions & 2 deletions application/recipes/rails_nginx_ree_passenger.rb
Expand Up @@ -89,11 +89,11 @@
if app.has_key?("deploy_key")
ruby_block "write_key" do
block do
f = File.open("#{app['deploy_to']}/id_deploy", "w")
f = ::File.open("#{app['deploy_to']}/id_deploy", "w")
f.print(app["deploy_key"])
f.close
end
not_if do File.exists?("#{app['deploy_to']}/id_deploy"); end
not_if do ::File.exists?("#{app['deploy_to']}/id_deploy"); end
end

file "#{app['deploy_to']}/id_deploy" do
Expand Down
4 changes: 2 additions & 2 deletions application/recipes/tomcat.rb
Expand Up @@ -33,7 +33,7 @@
notifies :restart, resources(:service => "tomcat")
end

if File.symlink?(File.join(node['tomcat']['context_dir'], "ROOT.xml"))
if ::File.symlink?(::File.join(node['tomcat']['context_dir'], "ROOT.xml"))
d = resources(:remote_file => app['id'])
d.notifies :restart, resources(:service => "tomcat")
end
end
4 changes: 2 additions & 2 deletions application/recipes/unicorn.rb
Expand Up @@ -31,7 +31,7 @@

unicorn_config "/etc/unicorn/#{app['id']}.rb" do
listen({ node[:unicorn][:port] => node[:unicorn][:options] })
working_directory File.join(app['deploy_to'], 'current')
working_directory ::File.join(app['deploy_to'], 'current')
worker_timeout node[:unicorn][:worker_timeout]
preload_app node[:unicorn][:preload_app]
worker_processes node[:unicorn][:worker_processes]
Expand All @@ -45,7 +45,7 @@
run_restart false
end

if File.exists?(File.join(app['deploy_to'], "current"))
if ::File.exists?(::File.join(app['deploy_to'], "current"))
d = resources(:deploy => app['id'])
d.restart_command do
execute "/etc/init.d/#{app['id']} hup"
Expand Down
4 changes: 2 additions & 2 deletions chef/metadata.json
Expand Up @@ -84,5 +84,5 @@
"chef::bootstrap_server": "Set up rubygem installed chef server",
"chef::server_proxy": "Configures Apache2 proxy for API and WebUI"
},
"version": "0.22.0"
}
"version": "0.22.1"
}
2 changes: 1 addition & 1 deletion chef/metadata.rb
Expand Up @@ -3,7 +3,7 @@
license "Apache 2.0"
description "Installs and configures Chef for chef-client and chef-server"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version "0.22.0"
version "0.22.1"
recipe "chef", "Default recipe is empty, use one of the other recipes."
recipe "chef::client", "Sets up a client to talk to a chef-server"
recipe "chef::client_service", "Sets up a client daemon to run periodically"
Expand Down
2 changes: 1 addition & 1 deletion chef/recipes/client.rb
Expand Up @@ -41,5 +41,5 @@
end

log "Add the chef::delete_validation recipe to the run list to remove the #{Chef::Config[:validation_key]}." do
only_if { File.exists?(Chef::Config[:validation_key]) }
only_if { ::File.exists?(Chef::Config[:validation_key]) }
end
2 changes: 1 addition & 1 deletion chef/recipes/server_proxy.rb
Expand Up @@ -53,7 +53,7 @@
openssl req -subj "#{node[:chef][:server_ssl_req]}" -new -x509 -nodes -sha1 -days 3650 -key #{node[:chef][:server_fqdn]}.key > #{node[:chef][:server_fqdn]}.crt
cat #{node[:chef][:server_fqdn]}.key #{node[:chef][:server_fqdn]}.crt > #{node[:chef][:server_fqdn]}.pem
EOH
not_if { File.exists?("/etc/chef/certificates/#{node[:chef][:server_fqdn]}.pem") }
not_if { ::File.exists?("/etc/chef/certificates/#{node[:chef][:server_fqdn]}.pem") }
end

web_app "chef_server" do
Expand Down
4 changes: 2 additions & 2 deletions glassfish/metadata.json
Expand Up @@ -26,7 +26,7 @@
]
},
"license": "Apache 2.0",
"version": "0.3.0",
"version": "0.3.1",
"maintainer": "Opscode, Inc.",
"suggestions": {
},
Expand All @@ -39,4 +39,4 @@
},
"description": "Installs/Configures Glassfish",
"long_description": "= DESCRIPTION:\n\n= REQUIREMENTS:\n\n= ATTRIBUTES: \n\n= USAGE:\n\n"
}
}
2 changes: 1 addition & 1 deletion glassfish/metadata.rb
Expand Up @@ -3,7 +3,7 @@
license "Apache 2.0"
description "Installs/Configures Glassfish"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.rdoc'))
version "0.3.0"
version "0.3.1"
recipe "glassfish", "Main Glassfish configuration"

%w{redhat centos debian ubuntu}.each do |os|
Expand Down
2 changes: 1 addition & 1 deletion glassfish/recipes/default.rb
Expand Up @@ -52,7 +52,7 @@

execute "install-glassfish" do
command "/tmp/glassfish.sh -a #{answer_file} -s"
creates File.join(node[:glassfish][:INSTALL_HOME],"uninstall.sh")
creates ::File.join(node[:glassfish][:INSTALL_HOME],"uninstall.sh")
user node[:glassfish][:systemuser]
action :run
end
Expand Down
4 changes: 2 additions & 2 deletions munin/metadata.json
Expand Up @@ -40,5 +40,5 @@
"munin::client": "Instlls munin and configures a client by searching for the server, which should have a role named monitoring",
"munin::server": "Installs munin and configures a server, node should have the role 'monitoring' so clients can find it"
},
"version": "0.10.0"
}
"version": "0.10.1"
}
2 changes: 1 addition & 1 deletion munin/metadata.rb
Expand Up @@ -3,7 +3,7 @@
license "Apache 2.0"
description "Installs and configures munin"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version "0.10.0"
version "0.10.1"

depends "apache2"
supports "arch"
Expand Down
2 changes: 1 addition & 1 deletion munin/recipes/server.rb
Expand Up @@ -68,7 +68,7 @@
source "apache2.conf.erb"
mode 0644
variables :public_domain => public_domain
if File.symlink?("#{node[:apache][:dir]}/sites-enabled/munin.conf")
if ::File.symlink?("#{node[:apache][:dir]}/sites-enabled/munin.conf")
notifies :reload, resources(:service => "apache2")
end
end
Expand Down
4 changes: 2 additions & 2 deletions nagios/metadata.json
Expand Up @@ -37,5 +37,5 @@
"nagios::client": "Installs and configures a nagios client with nrpe",
"nagios::server": "Installs and configures a nagios server"
},
"version": "0.4.3"
}
"version": "0.4.4"
}
2 changes: 1 addition & 1 deletion nagios/metadata.rb
Expand Up @@ -3,7 +3,7 @@
license "Apache 2.0"
description "Installs and configures nagios"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.rdoc'))
version "0.4.3"
version "0.4.4"

recipe "nagios", "Includes the client recipe."
recipe "nagios::client", "Installs and configures a nagios client with nrpe"
Expand Down
2 changes: 1 addition & 1 deletion nagios/recipes/server.rb
Expand Up @@ -117,7 +117,7 @@
source "apache2.conf.erb"
mode 0644
variables :public_domain => public_domain
if File.symlink?("#{node[:apache][:dir]}/sites-enabled/nagios3.conf")
if ::File.symlink?("#{node[:apache][:dir]}/sites-enabled/nagios3.conf")
notifies :reload, resources(:service => "apache2")
end
end
Expand Down
4 changes: 2 additions & 2 deletions nginx/definitions/nginx_site.rb
Expand Up @@ -23,13 +23,13 @@
execute "nxensite #{params[:name]}" do
command "/usr/sbin/nxensite #{params[:name]}"
notifies :restart, resources(:service => "nginx")
not_if do File.symlink?("#{node[:nginx][:dir]}/sites-enabled/#{params[:name]}") end
not_if do ::File.symlink?("#{node[:nginx][:dir]}/sites-enabled/#{params[:name]}") end
end
else
execute "nxdissite #{params[:name]}" do
command "/usr/sbin/nxdissite #{params[:name]}"
notifies :restart, resources(:service => "nginx")
only_if do File.symlink?("#{node[:nginx][:dir]}/sites-enabled/#{params[:name]}") end
only_if do ::File.symlink?("#{node[:nginx][:dir]}/sites-enabled/#{params[:name]}") end
end
end
end
4 changes: 2 additions & 2 deletions nginx/metadata.json
Expand Up @@ -234,7 +234,7 @@

]
},
"version": "0.14.3",
"version": "0.14.4",
"groupings": {
},
"long_description": "",
Expand All @@ -252,4 +252,4 @@
},
"conflicting": {
}
}
}
2 changes: 1 addition & 1 deletion nginx/metadata.rb
Expand Up @@ -2,7 +2,7 @@
maintainer_email "cookbooks@opscode.com"
license "Apache 2.0"
description "Installs and configures nginx"
version "0.14.3"
version "0.14.4"

recipe "nginx", "Installs nginx package and sets up configuration with Debian apache style with sites-enabled/sites-available"
recipe "nginx::source", "Installs nginx from source and sets up configuration with Debian apache style with sites-enabled/sites-available"
Expand Down
4 changes: 2 additions & 2 deletions rabbitmq_chef/metadata.json
Expand Up @@ -32,7 +32,7 @@
]
},
"license": "Apache 2.0",
"version": "0.10.3",
"version": "0.10.4",
"maintainer": "Opscode, Inc.",
"suggestions": {
},
Expand All @@ -45,4 +45,4 @@
},
"description": "Installs the RabbitMQ AMQP Broker for use on a Chef Server.",
"long_description": ""
}
}
2 changes: 1 addition & 1 deletion rabbitmq_chef/metadata.rb
Expand Up @@ -2,7 +2,7 @@
maintainer_email "cookbooks@opscode.com"
license "Apache 2.0"
description "Installs the RabbitMQ AMQP Broker for use on a Chef Server."
version "0.10.3"
version "0.10.4"

recipe "rabbitmq_chef", "Install and configure rabbitmq specifically for a Chef Server"

Expand Down
2 changes: 1 addition & 1 deletion rabbitmq_chef/recipes/default.rb
Expand Up @@ -26,7 +26,7 @@ def debian_before_squeeze?
if (platform?("ubuntu") && node.platform_version.to_f <= 9.10) || debian_before_squeeze?
include_recipe("erlang")

rabbitmq_dpkg_path = File.join(Chef::Config[:file_cache_path], "/", "rabbitmq-server_1.7.2-1_all.deb")
rabbitmq_dpkg_path = ::File.join(Chef::Config[:file_cache_path], "/", "rabbitmq-server_1.7.2-1_all.deb")

remote_file(rabbitmq_dpkg_path) do
checksum "ea2bbbb41f6d539884498bbdb5c7d3984643127dbdad5e9f7c28ec9df76b1355"
Expand Down
4 changes: 2 additions & 2 deletions redmine/metadata.json
Expand Up @@ -35,7 +35,7 @@
]
},
"license": "Apache 2.0",
"version": "0.10.2",
"version": "0.10.3",
"maintainer": "Opscode, Inc.",
"suggestions": {
},
Expand All @@ -48,4 +48,4 @@
},
"description": "Installs and configures redmine as a Rails app in passenger+apache2",
"long_description": ""
}
}

0 comments on commit 8c7b0c5

Please sign in to comment.