summaryrefslogtreecommitdiffstats
path: root/lib/puppet
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-09-21 19:43:45 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-09-21 19:43:45 +0000
commit9afdf1fa429cd5f81f68d27e172af208d6118e22 (patch)
treec0d31891ab7f87fd5753bfab9b058b156d1b5bf3 /lib/puppet
parent1ae434461d074dc859f768776af3934b66282d07 (diff)
downloadpuppet-9afdf1fa429cd5f81f68d27e172af208d6118e22.tar.gz
puppet-9afdf1fa429cd5f81f68d27e172af208d6118e22.tar.xz
puppet-9afdf1fa429cd5f81f68d27e172af208d6118e22.zip
Adding an Autoload instance to Type.rb so that I can load all known types for documentation purposes. And, of course, loading all types in puppetdoc. Also updating zone.rb to fix markdown's stupidity in trying to interpret the ERB template, and adding some timeouts to puppettest.rb
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1651 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/puppet')
-rw-r--r--lib/puppet/type.rb20
-rw-r--r--lib/puppet/type/zone.rb16
2 files changed, 26 insertions, 10 deletions
diff --git a/lib/puppet/type.rb b/lib/puppet/type.rb
index 0e0628202..13caf1973 100644
--- a/lib/puppet/type.rb
+++ b/lib/puppet/type.rb
@@ -128,6 +128,11 @@ class Type < Puppet::Element
end
+ # Load all types. Only currently used for documentation.
+ def self.loadall
+ typeloader.loadall
+ end
+
# Do an on-demand plugin load
def self.loadplugin(name)
unless Puppet[:pluginpath].split(":").include?(Puppet[:plugindest])
@@ -213,12 +218,11 @@ class Type < Puppet::Element
end
unless @types.include? name
- begin
- require "puppet/type/#{name}"
+ if typeloader.load(name)
unless @types.include? name
Puppet.warning "Loaded puppet/type/#{name} but no class was created"
end
- rescue LoadError => detail
+ else
# If we can't load it from there, try loading it as a plugin.
loadplugin(name)
end
@@ -227,6 +231,16 @@ class Type < Puppet::Element
@types[name]
end
+ def self.typeloader
+ unless defined? @typeloader
+ @typeloader = Puppet::Autoload.new(self,
+ "puppet/type", :wrap => false
+ )
+ end
+
+ @typeloader
+ end
+
# class methods dealing with type instance management
public
diff --git a/lib/puppet/type/zone.rb b/lib/puppet/type/zone.rb
index de94e51ca..c882e199c 100644
--- a/lib/puppet/type/zone.rb
+++ b/lib/puppet/type/zone.rb
@@ -287,21 +287,23 @@ end
desc %{The text to go into the sysidcfg file when the zone is first
booted. The best way is to use a template:
+ <pre><code>
# $templatedir/sysidcfg
system_locale=en_US
timezone=GMT
terminal=xterms
security_policy=NONE
- root_password=<%= password %>
+ root_password=&lt;%= password %>
timeserver=localhost
- name_service=DNS {domain_name=<%= domain %>
- name_server=<%= nameserver %>}
- network_interface=primary {hostname=<%= realhostname %>
- ip_address=<%= ip %>
- netmask=<%= netmask %>
+ name_service=DNS {domain_name=&lt;%= domain %>
+ name_server=&lt;%= nameserver %>}
+ network_interface=primary {hostname=&lt;%= realhostname %>
+ ip_address=&lt;%= ip %>
+ netmask=&lt;%= netmask %>
protocol_ipv6=no
- default_route=<%= defaultroute %>}
+ default_route=&lt;%= defaultroute %>}
nfs4_domain=dynamic
+ </code></pre>
And then call that: