summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Lewis <nick@puppetlabs.com>2011-06-10 10:32:30 -0700
committerNick Lewis <nick@puppetlabs.com>2011-06-10 10:32:30 -0700
commitd866ce187d45897acb9b099e7a4d77a2aadced8d (patch)
treef0ac1f96212f1d65964f958546857602ba9e2be9
parentb1a506c7dec849415073e1bf4b3c92f3c898d6d9 (diff)
downloadpuppet-d866ce187d45897acb9b099e7a4d77a2aadced8d.tar.gz
puppet-d866ce187d45897acb9b099e7a4d77a2aadced8d.tar.xz
puppet-d866ce187d45897acb9b099e7a4d77a2aadced8d.zip
Cleanup indentation, comment, and unused code
The Great Reindentation of '10 left certain structures indented incorrectly; this addresses some of these instances. The comment about loading all providers incorrectly stated that we're trying to figure out the type, when we're actually trying to figure out the provider. There was an unused variable initialization that was introduced in 2b14f627, which was reverting c19835c, 9290cc8, and ffb4c2d. Paired-with: Jacob Helwig <jacob@puppetlabs.com>
-rw-r--r--lib/puppet/metatype/manager.rb26
-rw-r--r--lib/puppet/type.rb18
2 files changed, 14 insertions, 30 deletions
diff --git a/lib/puppet/metatype/manager.rb b/lib/puppet/metatype/manager.rb
index 12cbf645c..3a2f77b6f 100644
--- a/lib/puppet/metatype/manager.rb
+++ b/lib/puppet/metatype/manager.rb
@@ -61,10 +61,9 @@ module Manager
# Then create the class.
- klass = genclass(
- name,
+ klass = genclass(
+ name,
:parent => (parent || Puppet::Type),
-
:overwrite => true,
:hash => @types,
:attributes => options,
@@ -87,13 +86,9 @@ module Manager
# Now set up autoload any providers that might exist for this type.
- klass.providerloader = Puppet::Util::Autoload.new(
- klass,
-
- "puppet/provider/#{klass.name.to_s}"
- )
+ klass.providerloader = Puppet::Util::Autoload.new(klass, "puppet/provider/#{klass.name.to_s}")
- # We have to load everything so that we can figure out the default type.
+ # We have to load everything so that we can figure out the default provider.
klass.providerloader.loadall
klass
@@ -103,11 +98,7 @@ module Manager
def rmtype(name)
# Then create the class.
- klass = rmclass(
- name,
-
- :hash => @types
- )
+ klass = rmclass(name, :hash => @types)
singleton_class.send(:remove_method, "new#{name}") if respond_to?("new#{name}")
end
@@ -132,12 +123,7 @@ module Manager
# Create a loader for Puppet types.
def typeloader
unless defined?(@typeloader)
-
- @typeloader = Puppet::Util::Autoload.new(
- self,
-
- "puppet/type", :wrap => false
- )
+ @typeloader = Puppet::Util::Autoload.new(self, "puppet/type", :wrap => false)
end
@typeloader
diff --git a/lib/puppet/type.rb b/lib/puppet/type.rb
index d24cc8554..58673462a 100644
--- a/lib/puppet/type.rb
+++ b/lib/puppet/type.rb
@@ -1442,15 +1442,14 @@ class Type
self.providify
- provider = genclass(
- name,
- :parent => parent,
- :hash => provider_hash,
- :prefix => "Provider",
- :block => block,
- :include => feature_module,
- :extend => feature_module,
-
+ provider = genclass(
+ name,
+ :parent => parent,
+ :hash => provider_hash,
+ :prefix => "Provider",
+ :block => block,
+ :include => feature_module,
+ :extend => feature_module,
:attributes => options
)
@@ -1581,7 +1580,6 @@ class Type
# Collect the current prereqs
list.each { |dep|
- obj = nil
# Support them passing objects directly, to save some effort.
unless dep.is_a? Puppet::Type
# Skip autorequires that we aren't managing