diff options
author | (no author) <(no author)@980ebf18-57e1-0310-9a29-db15c13687c0> | 2007-07-09 06:00:42 +0000 |
---|---|---|
committer | (no author) <(no author)@980ebf18-57e1-0310-9a29-db15c13687c0> | 2007-07-09 06:00:42 +0000 |
commit | 773f1876ae7cb64a17b872fb14219daba11dcd48 (patch) | |
tree | 457b370e373b8f508bac6428d9fde80f7a8a23d7 | |
parent | 1bcca319521987f5b7aa94ef16d3b3f0d41bde7f (diff) | |
download | puppet-773f1876ae7cb64a17b872fb14219daba11dcd48.tar.gz puppet-773f1876ae7cb64a17b872fb14219daba11dcd48.tar.xz puppet-773f1876ae7cb64a17b872fb14219daba11dcd48.zip |
Ignore the pkg directory if it exists, and fix up a couple of tests that were erroring out, which also will help the confinement of package types a bit more.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2663 980ebf18-57e1-0310-9a29-db15c13687c0
-rw-r--r-- | lib/puppet/provider/package/aptrpm.rb | 9 | ||||
-rwxr-xr-x | lib/puppet/provider/package/rpm.rb | 9 | ||||
-rwxr-xr-x | test/rails/collection.rb | 2 |
3 files changed, 19 insertions, 1 deletions
diff --git a/lib/puppet/provider/package/aptrpm.rb b/lib/puppet/provider/package/aptrpm.rb index 00d60b236..8ceacbc78 100644 --- a/lib/puppet/provider/package/aptrpm.rb +++ b/lib/puppet/provider/package/aptrpm.rb @@ -10,6 +10,15 @@ Puppet::Type.type(:package).provide :aptrpm, :parent => :rpm, :source => :rpm do commands :aptcache => "/usr/bin/apt-cache" commands :rpm => "/usr/bin/rpm" + confine :true => begin + rpm('-ql', 'rpm') + rescue Puppet::ExecutionFailure + false + else + true + end + + # Install a package using 'apt-get'. This function needs to support # installing a specific version. def install diff --git a/lib/puppet/provider/package/rpm.rb b/lib/puppet/provider/package/rpm.rb index 542ac89fc..0787f7e8c 100755 --- a/lib/puppet/provider/package/rpm.rb +++ b/lib/puppet/provider/package/rpm.rb @@ -11,6 +11,15 @@ Puppet::Type.type(:package).provide :rpm, :source => :rpm, :parent => Puppet::Pr commands :rpm => "rpm" + confine :true => begin + rpm('-ql', 'rpm') + rescue Puppet::ExecutionFailure + false + else + true + end + + def self.instances packages = [] diff --git a/test/rails/collection.rb b/test/rails/collection.rb index 05baf41cd..005d4502c 100755 --- a/test/rails/collection.rb +++ b/test/rails/collection.rb @@ -188,7 +188,7 @@ class TestRailsCollection < PuppetTest::TestCase # Make our configuration host = Puppet::Rails::Host.new(:name => "myhost") - host.resources.build(:title => "/tmp/hosttest", :type => "file", + host.resources.build(:title => "/tmp/hosttest", :restype => "file", :exported => true) host.save |