Issue #4285 has been updated by James Turnbull.

Patch inline too:

<pre>

diff --git a/lib/puppet/resource.rb b/lib/puppet/resource.rb
index 55874ae..ca7c212 100644
--- a/lib/puppet/resource.rb
+++ b/lib/puppet/resource.rb
@@ -217,7 +217,11 @@ class Puppet::Resource
   end
 
   def uniqueness_key
-    self.to_hash.values_at(*key_attributes.sort_by { |k| k.to_s })
+    # Temporary kludge to deal with inconsistant use patters
+    h = self.to_hash
+    h[namevar] ||= h[:name]
+    h[:name]   ||= h[namevar]
+    h.values_at(*key_attributes.sort_by { |k| k.to_s })
   end
 
   def key_attributes
</pre>
----------------------------------------
Bug #4285: ArgumentError: Cannot alias File[mytitle] to [nil]
http://projects.puppetlabs.com/issues/4285

Author: Alan Barrett
Status: Ready for Testing
Priority: Normal
Assigned to: Markus Roberts
Category: 
Target version: 2.6.0
Affected version: 2.6.0rc4
Keywords: 
Branch: MarkusQ:ticket/master/4285


With puppet 2.6.0rc4, I get the following error:

<pre>
Puppet::Parser::AST::Resource failed with error ArgumentError: Cannot alias 
File[mytitle] to [nil]; resource ["File", [nil]] already exists at 
/dir/filename.pp:25 on node myhost.domain.example
</pre>

The offending part of the manifest is

<pre>
file { "mytitle":
    name => "/dir/subdir/file",
    source => "puppet:///modules/mymodule/file",
}
</pre>

Most of my file resources do not have explicit "name" parameters", and have the 
full path name in the title parameter.  The error appears to be triggered by 
the second file resource that has an explicit "name" parameter.
I have been unable to create a small standalone manifest that demonstrates the 
problem.



-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to