Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed bug with auto-creation of concat_build objects.

  • Loading branch information...
commit 15e8d5f5755824b285b17333e730aacc69bed120 1 parent f438b6b
Morgan Haskel authored
Showing with 14 additions and 13 deletions.
  1. +12 −13 lib/puppet/type/concat_fragment.rb
  2. +2 −0  pkg/pupmod-concat.spec
View
25 lib/puppet/type/concat_fragment.rb
@@ -18,19 +18,6 @@
concat_build object, then one will be created for you and the
defaults will be used."
- def initialize(args)
- super
-
- # If the user did not specify a concat_build object in their manifest,
- # assume that they want the defaults and create one for them.
- if not @catalog.resource("Concat_build[#{self[:frag_group]}]") then
- debug "Auto-adding 'concat_build' resource Concat_build['#{self[:frag_group]}'] to the catalog"
- @catalog.add_resource(Puppet::Type.type(:concat_build).new(
- :name => "#{self[:frag_group]}"
- ))
- end
- end
-
newparam(:name) do
isnamevar
validate do |value|
@@ -92,6 +79,17 @@ def sync
fail Puppet::Error, "You must specify content" unless self[:content]
end
+ def create_default_build
+ # If the user did not specify a concat_build object in their manifest,
+ # assume that they want the defaults and create one for them.
+ if not @catalog.resource("Concat_build[#{self[:frag_group]}]") then
+ debug "Auto-adding 'concat_build' resource Concat_build['#{self[:frag_group]}'] to the catalog"
+ @catalog.add_resource(Puppet::Type.type(:concat_build).new(
+ :name => "#{self[:frag_group]}"
+ ))
+ end
+ end
+
def purge_unknown_fragments
# Kill all unmanaged fragments for this group
known_resources = []
@@ -117,6 +115,7 @@ def purge_unknown_fragments
end
def finish
+ create_default_build
purge_unknown_fragments
super
end
View
2  pkg/pupmod-concat.spec
@@ -50,6 +50,8 @@ chmod -R u=rwX,g=rX,o-rwx %{buildroot}/etc/puppet/modules/concat
/etc/puppet/modules/concat
%changelog
+* Tue Aug 14 2012 Morgan Haskel <morgan.haskel@onyxpoint.com> - 2.0-1
+- Fixed bug in auto-creation of build objects.
* Sun Jul 22 2012 Trevor Vaughan <tvaughan@onyxpoint.com> - 2.0-0
- Multiple updates to the concat codebase.
Please sign in to comment.
Something went wrong with that request. Please try again.