Skip to content

Instantly share code, notes, and snippets.

@gondoi
Created January 18, 2011 17:49
Show Gist options
  • Save gondoi/784827 to your computer and use it in GitHub Desktop.
Save gondoi/784827 to your computer and use it in GitHub Desktop.
monkey patch for apt lock files
require 'chef/provider/package/apt'
class Chef
class Provider
class Package
class Apt
class Safe < Chef::Provider::Package::Apt
def install_package(name, version)
Rackspace::Locks.wait_on_lock(new_resource.timeout)
run_command_with_systems_locale(
:command => "apt-get -q -y#{expand_options(@new_resource.options)} install #{name}=#{version}",
:environment => {
"DEBIAN_FRONTEND" => "noninteractive"
}
)
end
end
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment