Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

  • Loading branch information...
commit 361d6a3a6917fd9515a2180590fb671024132da7 2 parents ddc4e14 + 0352402
@joshcooper joshcooper authored
Showing with 9 additions and 1 deletion.
  1. +9 −1 lib/puppet/provider/naginator.rb
View
10 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)
Please sign in to comment.
Something went wrong with that request. Please try again.