summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2008-04-21 23:45:53 -0500
committerLuke Kanies <luke@madstop.com>2008-04-21 23:45:53 -0500
commit0e8a1c9f6ac45e9e6f6dcf6464ad4d2780201ce1 (patch)
tree0bcf46830c65667ebf85e44f8699243f8da5a5f3 /lib
parent58fb416e9f52a9dc834b735ffa7e5c425495c982 (diff)
parent62ca72608c8fcded624c46c6951b9381a7284a80 (diff)
downloadpuppet-0e8a1c9f6ac45e9e6f6dcf6464ad4d2780201ce1.tar.gz
puppet-0e8a1c9f6ac45e9e6f6dcf6464ad4d2780201ce1.tar.xz
puppet-0e8a1c9f6ac45e9e6f6dcf6464ad4d2780201ce1.zip
Merge branch '0.24.x'
Conflicts: bin/puppetca
Diffstat (limited to 'lib')
-rw-r--r--lib/puppet/network/http_pool.rb5
-rw-r--r--lib/puppet/network/xmlrpc/client.rb2
-rwxr-xr-xlib/puppet/provider/package/freebsd.rb19
-rwxr-xr-xlib/puppet/provider/package/ports.rb7
-rw-r--r--lib/puppet/rails/database/schema.rb9
-rw-r--r--lib/puppet/rails/resource.rb1
6 files changed, 35 insertions, 8 deletions
diff --git a/lib/puppet/network/http_pool.rb b/lib/puppet/network/http_pool.rb
index 9d37f2eeb..1227f78dc 100644
--- a/lib/puppet/network/http_pool.rb
+++ b/lib/puppet/network/http_pool.rb
@@ -88,8 +88,9 @@ module Puppet::Network::HttpPool
class << http; attr_accessor :ca_file; end
http.use_ssl = true
- http.read_timeout = 120
- http.open_timeout = 120
+ # Use configured timeout (#1176)
+ http.read_timeout = Puppet[:configtimeout]
+ http.open_timeout = Puppet[:configtimeout]
# JJM Configurable fix for #896.
if Puppet[:http_enable_post_connection_check]
http.enable_post_connection_check = true
diff --git a/lib/puppet/network/xmlrpc/client.rb b/lib/puppet/network/xmlrpc/client.rb
index 357a766a1..e0fb5a0ab 100644
--- a/lib/puppet/network/xmlrpc/client.rb
+++ b/lib/puppet/network/xmlrpc/client.rb
@@ -123,7 +123,7 @@ module Puppet::Network
nil, # user
nil, # password
true, # use_ssl
- 120 # a two minute timeout, instead of 30 seconds
+ Puppet[:configtimeout] # use configured timeout (#1176)
)
@http = Puppet::Network::HttpPool.http_instance(@host, @port)
end
diff --git a/lib/puppet/provider/package/freebsd.rb b/lib/puppet/provider/package/freebsd.rb
index f98f3064e..18df015fd 100755
--- a/lib/puppet/provider/package/freebsd.rb
+++ b/lib/puppet/provider/package/freebsd.rb
@@ -18,11 +18,22 @@ Puppet::Type.type(:package).provide :freebsd, :parent => :openbsd do
def install
should = @resource.should(:ensure)
- if @resource[:source]
- return super
+ if @resource[:source] =~ /\/$/
+ if @resource[:source] =~ /^(ftp|https?):/
+ withenv :PACKAGESITE => @resource[:source] do
+ pkgadd "-r", @resource[:name]
+ end
+ else
+ withenv :PKG_PATH => @resource[:source] do
+ pkgadd @resource[:name]
+ end
+ end
+ else
+ if @resource[:source]
+ Puppet.warning "source is defined but does not have trailing slash, ignoring %s" % @resource[:source]
+ end
+ pkgadd "-r", @resource[:name]
end
-
- pkgadd "-r", @resource[:name]
end
def query
diff --git a/lib/puppet/provider/package/ports.rb b/lib/puppet/provider/package/ports.rb
index 1cff30039..99e26ef23 100755
--- a/lib/puppet/provider/package/ports.rb
+++ b/lib/puppet/provider/package/ports.rb
@@ -72,8 +72,13 @@ Puppet::Type.type(:package).provide :ports, :parent => :freebsd, :source => :fre
end
def query
+ # support portorigin_glob such as "mail/postfix"
+ name = self.name
+ if name =~ /\//
+ name = self.name.split(/\//).slice(1)
+ end
self.class.instances.each do |instance|
- if instance.name == self.name
+ if instance.name == name
return instance.properties
end
end
diff --git a/lib/puppet/rails/database/schema.rb b/lib/puppet/rails/database/schema.rb
index 5365ce2a4..d11d91aa5 100644
--- a/lib/puppet/rails/database/schema.rb
+++ b/lib/puppet/rails/database/schema.rb
@@ -14,6 +14,7 @@ class Puppet::Rails::Schema
t.column :exported, :boolean
t.column :line, :integer
t.column :updated_at, :datetime
+ t.column :created_at, :datetime
end
add_index :resources, :id, :integer => true
add_index :resources, :host_id, :integer => true
@@ -31,6 +32,7 @@ class Puppet::Rails::Schema
t.column :filename, :string
t.column :path, :string
t.column :updated_at, :datetime
+ t.column :created_at, :datetime
end
add_index :source_files, :id, :integer => true
add_index :source_files, :filename
@@ -39,6 +41,7 @@ class Puppet::Rails::Schema
t.column :resource_id, :integer
t.column :puppet_tag_id, :integer
t.column :updated_at, :datetime
+ t.column :created_at, :datetime
end
add_index :resource_tags, :id, :integer => true
add_index :resource_tags, :resource_id, :integer => true
@@ -47,6 +50,7 @@ class Puppet::Rails::Schema
create_table :puppet_tags do |t|
t.column :name, :string
t.column :updated_at, :datetime
+ t.column :created_at, :datetime
end
add_index :puppet_tags, :id, :integer => true
@@ -59,6 +63,7 @@ class Puppet::Rails::Schema
#Use updated_at to automatically add timestamp on save.
t.column :updated_at, :datetime
t.column :source_file_id, :integer
+ t.column :created_at, :datetime
end
add_index :hosts, :id, :integer => true
add_index :hosts, :source_file_id, :integer => true
@@ -67,6 +72,7 @@ class Puppet::Rails::Schema
create_table :fact_names do |t|
t.column :name, :string, :null => false
t.column :updated_at, :datetime
+ t.column :created_at, :datetime
end
add_index :fact_names, :id, :integer => true
add_index :fact_names, :name
@@ -76,6 +82,7 @@ class Puppet::Rails::Schema
t.column :fact_name_id, :integer, :null => false
t.column :host_id, :integer, :null => false
t.column :updated_at, :datetime
+ t.column :created_at, :datetime
end
add_index :fact_values, :id, :integer => true
add_index :fact_values, :fact_name_id, :integer => true
@@ -87,6 +94,7 @@ class Puppet::Rails::Schema
t.column :line, :integer
t.column :resource_id, :integer
t.column :updated_at, :datetime
+ t.column :created_at, :datetime
end
add_index :param_values, :id, :integer => true
add_index :param_values, :param_name_id, :integer => true
@@ -95,6 +103,7 @@ class Puppet::Rails::Schema
create_table :param_names do |t|
t.column :name, :string, :null => false
t.column :updated_at, :datetime
+ t.column :created_at, :datetime
end
add_index :param_names, :id, :integer => true
add_index :param_names, :name
diff --git a/lib/puppet/rails/resource.rb b/lib/puppet/rails/resource.rb
index 785c63419..0053dc28d 100644
--- a/lib/puppet/rails/resource.rb
+++ b/lib/puppet/rails/resource.rb
@@ -98,6 +98,7 @@ class Puppet::Rails::Resource < ActiveRecord::Base
hash.delete("host_id")
hash.delete("updated_at")
hash.delete("source_file_id")
+ hash.delete("created_at")
hash.delete("id")
hash.each do |p, v|
hash.delete(p) if v.nil?