Permalink
Browse files

Merge branch 'tickets/2.6.next/3420' into 2.6.next

  • Loading branch information...
2 parents ddc4e14 + 0352402 commit 361d6a3a6917fd9515a2180590fb671024132da7 @joshcooper joshcooper committed Apr 26, 2011
Showing with 9 additions and 1 deletion.
  1. +9 −1 lib/puppet/provider/naginator.rb
@@ -30,7 +30,15 @@ def self.parse(text)
end
def self.to_file(records)
- header + records.collect { |record| record.to_s }.join("\n").gsub("_naginator_name", NAME_STRING)
+ header + records.collect { |record|
+ # Remap the TYPE_name or _naginator_name params to the
+ # name if the record is a template (register == 0)
+ if record.to_s =~ /register\s+0/
+ record.to_s.sub("_naginator_name", "name").sub(record.type.to_s + "_name", "name")
+ else
+ record.to_s.sub("_naginator_name", NAME_STRING)
+ end
+ }.join("\n")
end
def self.skip_record?(record)

0 comments on commit 361d6a3

Please sign in to comment.